Skip to content

feat(ai): embed search text with EmbeddingGemma 2 - #2118

Merged
ucguy4u merged 1 commit into
mainfrom
cursor/embeddinggemma-2-litert-8768
Oct 16, 2026
Merged

ucguy4u merged 1 commit into
mainfrom
cursor/embeddinggemma-2-litert-8768

Conversation

@ucguy4u

@ucguy4u ucguy4u commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Semantic search now prefers Google's generic EmbeddingGemma 2 text package (embeddinggemma-2-text-270m.litertlm, 164,626,432 bytes) through LiteRT-LM EmbeddingEngine. Search prompts use EmbeddingGemma 2's task prefixes, and the engine loads with a 512-token input.

The older EmbeddingGemma 300M .tflite file and its tokenizer stay in the catalog. If that file is already installed, search keeps using it through the RAG SDK. A new install is asked for EmbeddingGemma 2 and does not need a separate tokenizer.

Test Plan

  • dart analyze on the embeddings and catalog files
  • flutter test for embedding_client_test, embedding_service_test, and model_catalog_test (34 tests)
  • scripts/check-docs-completeness.sh --base origin/main --head HEAD
  • Manual device verification documented, or not applicable

Verification environment: Host-only. The Kotlin EmbeddingEngine call was checked against the litertlm-android 0.18.0 API. It was not run on a device.

Agent Policy

  • Linked issue includes a Critical Agent Gate.
  • Linked issue includes a Feature Packet or documents why one is not needed.
  • Cross-agent contract is documented for framework/application boundary work. This stays inside core_ai and the existing Android LiteRT plugin.
  • Deterministic use cases and automation flows are linked or included.
  • AI/tool/memory/routine changes include eval, trace, and redaction coverage. Embedding tests cover the prefix, the no-tokenizer path, and the already-installed 300M preference.
  • Android Emulator was not used.

Council Review

  • Media Intelligence Architect: catalog and embedding runtime change

  • Flutter Architect: core_ai embedding client and service

  • Platform Architect: Android LiteRT plugin methods

  • I checked the Decision Matrix and listed every required role above.

  • Every package touched has a module.yaml.

  • owner/reviewers in any touched module.yaml still match who actually reviewed this PR.

Open in Web Open in Cursor 

Prefer the generic EmbeddingGemma 2 text package through LiteRT-LM, and keep the existing EmbeddingGemma 300M file working when it is already installed.

Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Plugin Module Size Gate

Policy: modules over 3 MB must be delivered as plugins; plugin modules over 5 MB must document cache management.

Module Size Type Status
packages/core_ai 0.59 MB bundled OK

@ucguy4u
ucguy4u marked this pull request as ready for review October 16, 2026 17:49
@ucguy4u
ucguy4u merged commit f77e761 into main Oct 16, 2026
16 of 19 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚀 PR Quick Check Summary

Check Status Description
PR Validation ❌ failure Title format, docs, bundled model guardrail
Code Quality ✅ success Analyze, formatting
Core Tests ✅ success Core package unit tests
Airo Mind Shell ✅ success Mind flavour analyze, tests, entrypoint compile

💡 Note: Full app tests, coverage reports, and security scans run on merge to main.

View Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants