Skip to content

feat(llm): switch default embedder nomic → EmbeddingGemma 300M - #1952

Merged
kovtcharov-amd merged 15 commits into
mainfrom
feat/embeddinggemma-embedder
Jul 8, 2026
Merged

kovtcharov-amd merged 15 commits into
mainfrom
feat/embeddinggemma-embedder

Conversation

@kovtcharov-amd

@kovtcharov-amd kovtcharov-amd commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

Why this matters

The current llama.cpp server can't load nomic-embed-text-v2-moe — GAIA's default embedder — so on any up-to-date Lemonade build, RAG, code-index, and agent-memory embedding silently break (the model fails to load; retrieval and memory stop working). This switches the default to EmbeddingGemma 300M, which loads cleanly on current llama.cpp. It's 768-dim (same as nomic), so index shapes and retrieval behavior are unchanged; existing indexes/caches re-embed automatically on next run.

EmbeddingGemma is a Lemonade custom user-model: /v1/pull registers it as user.embeddinggemma-300m-GGUF (checkpoint ggml-org/embeddinggemma-300M-GGUF:Q8_0, recipe=llamacpp, embedding=true — the flag sets the embeddings label explicitly, sidestepping the #1745 auto-label bug). Note that Lemonade then lists it under the stripped id embeddinggemma-300m-GGUF while /load and /embeddings accept either form — so the availability check is user.-prefix-tolerant to avoid a re-pull loop.

Live validation (Lemonade Server 10.9.0)

  • ensure_model_downloaded("user.embeddinggemma-300m-GGUF") resolves the registered model instantly (no re-pull hang)
  • gaia init --profile chat download path resolves both models cleanly
  • /embeddings returns 768-dim vectors under the user.-prefixed name
  • Full RAG round-trip: index a doc → correct chunk retrieved → correct answer, using EmbeddingGemma
  • Unit tests green (test_lemonade_client, test_memory_store, test_code_index, test_tool_call_priority, test_llamacpp_backend, test_rag), incl. new pull-shape + namespace-matcher tests; black/isort clean

Still to verify (couldn't run in this env)

  • Cold registration from empty — on 10.9.0 the model was already registered, so a truly-fresh /pull register-from-scratch wasn't exercised end-to-end.
  • RAG eval vs baseline — the eval's Claude judge needs the anthropic SDK (not installed) and a real ANTHROPIC_API_KEY (currently a dummy value); run gaia eval agent --category rag_quality --agent-type doc and --compare to tests/fixtures/eval_baselines/gemma-4-e4b-d71cd914/scorecard_rag_quality.json in an env with judge access.

The current llama.cpp server can't load nomic-embed-text-v2-moe, which
broke RAG, code-index, and agent-memory embedding on any up-to-date
Lemonade build. Default to EmbeddingGemma 300M instead.

Lemonade ships no built-in EmbeddingGemma, so it's registered as the
custom user-model user.embeddinggemma-300m-GGUF (checkpoint
ggml-org/embeddinggemma-300M-GGUF:Q8_0, recipe llamacpp) with the
embedding=true pull flag — which sets the embeddings label explicitly
and avoids the #1745 auto-label bug. It's 768-dim, same as nomic, so
FAISS index shapes and EMBEDDING_DIM stay unchanged.

Memory vectors are model-specific and the dim check can't catch a model
swap (both 768-dim), so memory now records the embedder name and
clears+re-embeds stale vectors when it changes. RAG/code-index caches
already self-invalidate on embedding_model change.
@github-actions github-actions Bot added documentation Documentation changes devops DevOps/infrastructure changes rag RAG system changes llm LLM backend changes tests Test changes performance Performance-critical changes agents agent::emr Medical-intake (EMR) agent changes labels Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve — safe to merge as-is; the notes below are optional polish, not blockers.

This swaps GAIA's default embedder from nomic-embed-text-v2-moe (which the current llama.cpp server can't load, silently breaking RAG / code-index / agent-memory) to EmbeddingGemma 300M. Both are 768-dim, so index shapes and retrieval behavior are unchanged. The change is thorough: the new model is registered as a user. custom model with the correct pull shape (checkpoint + recipe=llamacpp + explicit embedding=true to sidestep the #1745 auto-label bug), agent-memory auto-clears stale vectors on the model change so they re-embed, and every doc surface that named the old model is updated in lockstep.

The bottom line reviewers should know: this only registers the pull shape — the live Lemonade contract (fresh cold-pull on a real box) still needs the boundary test the author left unchecked in the test plan. Nothing in the diff can prove that end-to-end, which is exactly the right call to flag.

No security concerns.

🔍 Technical details

🟢 Minor / nits

1. code_index/sdk.py ignores the ensure_model_downloaded() return value (src/gaia/code_index/sdk.py:668)
The RAG SDK raises loudly when registration returns False (rag/sdk.py:930), but the code-index path discards the return. In practice the subsequent load_model() still fails loudly with an actionable RuntimeError, so this isn't a silent-fallback violation — just an inconsistency. Optional tightening for parity:

            if mr and self.config.embedding_model.startswith("user."):
                if not self._llm_client.ensure_model_downloaded(
                    self.config.embedding_model,
                    checkpoint=mr.checkpoint,
                    recipe=mr.recipe,
                    embedding=mr.embedding,
                ):
                    raise RuntimeError(
                        f"Failed to register/download embedding model "
                        f"{self.config.embedding_model!r}. Ensure Lemonade Server "
                        f"is running, then retry."
                    )

2. Procedures embeddings are cleared but not re-backfilled on the migration run (src/gaia/agents/base/memory.py:445)
clear_all_embeddings() NULLs both the knowledge and procedures tables, but Step 3's _backfill_embeddings() only re-embeds knowledge (get_items_without_embeddings reads the knowledge table). Procedures rely on skill-synthesis to re-embed on a later pass, so immediately after the nomic→Gemma migration, procedural-memory recall is degraded until skill-synthesis reruns. This is off the hot path and the subsystem is experimental, so it's acceptable — but worth a one-line comment at the clear site noting procedures re-embed lazily via skill-synthesis, not via this backfill, so a future reader doesn't assume Step 3 covers them.

3. EMR disk-space note (docs/guides/emr.mdx) — the per-model row dropped from 522 MB → ~334 MB but the "at least 25 GB free" guidance is unchanged. Fine (headroom), just noting the two lines were reviewed together.

Strengths

  • Contract-validity test, not just invocation — test_pull_embedding_model_request_shape asserts the outgoing /pull body carries user. prefix + checkpoint + recipe + embedding=true together, exactly the CLAUDE.md "mocks prove the call is valid" bar, and directly guards the gaia init --profile npu fails with status 400 (missing user. prefix for model name) #1655/fix(npu): default 32k context on NPU profile + resolve 4096↔32768 runtime mismatch #1745 regressions.
  • Model-aware migration — clearing vectors on a model change (keyed on stored embedding_model in settings, since the 768-dim check can't distinguish the two models) is the correct fix for the "old vectors silently mismatch new queries" trap, and it ships with a unit test that verifies rows survive while embeddings go NULL.
  • Doc sync is complete — glossary, code-index, emr, RAG/memory SDK specs, CLI profiles table, and the memory-architecture spec all updated in one pass, with migration <Note> blocks explaining the auto-reindex. No surface left contradicting another.
  • Fails loud — RAG registration raises with an actionable message rather than falling back to nomic.

Validated against a live Lemonade Server (10.9.0): EmbeddingGemma is a
custom user-model, so /v1/pull registers it as user.embeddinggemma-300m-GGUF
but /v1/models lists it under the stripped id embeddinggemma-300m-GGUF
(/load and /embeddings accept either form). The availability check in
ensure_model_downloaded compared raw strings, so it never matched the
registered model and re-pulled on every call — an observed hang.

Add a user.-prefix-tolerant name matcher and use it in the availability,
download-wait, and loaded-model checks. Runtime validation now passes:
ensure_model_downloaded returns immediately, gaia init resolves the
embedder, and a full RAG index→retrieve→answer round-trip works.

Also refines the embedder docs (agent-ui/code-index/rag) to match actual
cache-invalidation behavior.
kovtcharov-amd pushed a commit that referenced this pull request Jul 7, 2026
Generalize the embedder hardware test to validate EmbeddingGemma 300M on both
backends GAIA uses: the GGUF/llamacpp variant (user.embeddinggemma-300m-GGUF,
the non-NPU default replacing nomic, #1952) and the FLM/NPU variant
(embed-gemma-300m-FLM, #1744). The vector-level checks — 768-dim, finite,
non-zero, deterministic, distinct-texts-differ — are shared and parametrized
across both backends; the chat+embedder co-residency check stays FLM-specific.

Each backend gates on the live Lemonade catalog and skips when absent, so the
GGUF variant runs on GPU/Vulkan boxes and the stx CI runner while FLM runs on
Ryzen AI NPU runners — neither produces a false failure where its model isn't
present. Verified locally: GGUF variant passes against a real EmbeddingGemma
GGUF model (4 passed), FLM variant skips cleanly with no server error.
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🟡 CodeIndexSDK never recognizes the new embedder as already loaded — it reloads it on every gaia-code index call.

_init_embedder builds running from the health endpoint's model IDs, then checks self.config.embedding_model not in running. But Lemonade reports user.-registered models under their stripped id (embeddinggemma-300m-GGUF), while self.config.embedding_model is user.embeddinggemma-300m-GGUF. The membership test always fails, so load_model fires on every invocation even when the embedder is sitting idle and ready. The _model_ids_match helper added in this same PR exists precisely to handle this comparison — it just wasn't applied here.

RAGSDK doesn't have this issue because it unconditionally unloads-then-reloads the embedder in a scoped swap; CodeIndexSDK's "skip if already loaded" optimization is what broke.

🔍 Technical details

src/gaia/code_index/sdk.py:677-683 — newly added block:

health = self._llm_client.health_check()
running = [m.get("id", "") for m in health.get("all_models_loaded", [])]
if self.config.embedding_model not in running:   # ← raw string compare
    self._llm_client.load_model(
        self.config.embedding_model,
        llamacpp_args="--ubatch-size 2048 --split-mode none",
    )

Fix — swap the membership test for _model_ids_match:

from gaia.llm.lemonade_client import _model_ids_match

if not any(_model_ids_match(rid, self.config.embedding_model) for rid in running):
    self._llm_client.load_model(...)

Secondary: ensure_model_downloaded's return value (line 668) is silently discarded. RAGSDK raises RuntimeError on False; CodeIndexSDK should too, or a failed registration produces a confusing downstream embedding error rather than the actionable "Failed to register/download…" message.

kovtcharov
kovtcharov previously approved these changes Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🟡 code_index/sdk.py silently swallows a failed embedder registration — if the user.embeddinggemma-300m-GGUF download fails, gaia-code index will proceed and crash with a confusing embedder error instead of the actionable "Failed to register/download" message you wired up in rag/sdk.py.

The rag/sdk.py block has a comment that says exactly this ("Fail loudly if registration fails") and checks the return value. The identical new block in code_index/sdk.py doesn't.

🔍 Technical details

src/gaia/rag/sdk.py:501-510 (correct pattern):

if not self.llm_client.ensure_model_downloaded(
    self.config.embedding_model,
    checkpoint=mr.checkpoint,
    recipe=mr.recipe,
    embedding=mr.embedding,
):
    raise RuntimeError(
        f"Failed to register/download embedding model ..."
    )

src/gaia/code_index/sdk.py:667-673 (missing the check):

if mr and self.config.embedding_model.startswith("user."):
    self._llm_client.ensure_model_downloaded(   # ← return value ignored
        self.config.embedding_model,
        checkpoint=mr.checkpoint,
        recipe=mr.recipe,
        embedding=mr.embedding,
    )

Fix: mirror the RAG pattern — check the bool return and raise a RuntimeError with an actionable message (referencing gaia init --profile chat or the code-index docs).

…ingGemma

Two fixes for the embedder switch:

1. _download_models passed checkpoint/recipe/embedding=None to
   ensure_model_downloaded for EVERY model, including built-ins — which
   broke test_npu_profile_pulls_builtin_model_without_recipe and risked
   Lemonade treating a built-in pull as a custom registration (#1655).
   Only user.-namespaced models now carry those kwargs; built-ins are
   pulled by name.

2. EmbeddingGemma is validated on Lemonade v10.9.0; older bundled
   llama.cpp builds fail to load it. Bump LEMONADE_VERSION to 10.9.0 and
   floor the chat/rag/all init profiles at 10.9.0 so init fails loudly
   instead of the embedder failing at first RAG index. reset-lemonade.ps1
   fallback bumped to match.
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🟡 The code_index embedder "already loaded?" guard doesn't use _model_ids_match, so EmbeddingGemma triggers a spurious load_model call on every cold init of the code-index embedder.

The health endpoint returns the model's stripped id (embeddinggemma-300m-GGUF), but self.config.embedding_model is user.embeddinggemma-300m-GGUF. The plain not in check can never match, so load_model is called even when the embedder is already loaded. The rest of the PR applied _model_ids_match precisely to handle this strip, but missed this spot. Whether the unneeded load_model call evicts-then-reloads the model or is a no-op depends on Lemonade's behaviour, but it's a regression either way.

🔍 Technical details

src/gaia/code_index/sdk.py:678-680 (existing code the PR left unchanged):

running = [m.get("id", "") for m in health.get("all_models_loaded", [])]
if self.config.embedding_model not in running:   # <-- plain `in`, no prefix strip
    self._llm_client.load_model(...)

The _ensure_model_loaded path in lemonade_client.py was updated to use _model_ids_match (diff line +2730) for exactly this reason, confirming the health endpoint returns the stripped form. The same fix is needed here:

from gaia.llm.lemonade_client import _model_ids_match
...
if not any(_model_ids_match(r, self.config.embedding_model) for r in running):
    self._llm_client.load_model(...)

The LEMONADE_VERSION bump to 10.9.0 left hardcoded 10.8.1 references in
docs/cpp/setup.mdx, docs/guides/npu.mdx, and cpp/README.md, which
util/check_doc_versions.py flags as mismatches (fails the validate +
code-quality jobs). Sync them to 10.9.0.
@github-actions github-actions Bot added the cpp label Jul 7, 2026
…mbedder

# Conflicts:
#	src/gaia/agents/base/memory.py
#	src/gaia/agents/base/memory_store.py
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🔴 registry.py still has the old nomic model name — RAG will fail for all GPU/CPU users of gaia chat.

src/gaia/agents/registry.py:222 was not updated in this push and still reads:

DEFAULT_EMBEDDING_MODEL = "nomic-embed-text-v2-moe-GGUF"

The ChatAgent calls get_embedding_model_for_device(config.device) (line 267 of hub/agents/python/chat/gaia_agent_chat/agent.py) which, for GPU/CPU/unknown devices, returns registry.DEFAULT_EMBEDDING_MODEL. That means it hands the old nomic model id to the RAG SDK — which the current llama.cpp server can't load — instead of user.embeddinggemma-300m-GGUF. Document indexing and RAG will break on the default GPU profile even after gaia init --profile chat installs the new model.

tests/unit/test_npu_flm_embedder.py:38 also asserts the old name, so it continues to pass while testing the wrong thing.

🔍 Technical details

Root cause: registry.py has its own copy of the default embedding model name that was not synced with the lemonade_client.py DEFAULT_EMBEDDING_MODEL rename.

Files to fix:

src/gaia/agents/registry.py:222 — import from lemonade_client instead of duplicating:

# before
DEFAULT_EMBEDDING_MODEL = "nomic-embed-text-v2-moe-GGUF"

# after
from gaia.llm.lemonade_client import DEFAULT_EMBEDDING_MODEL  # "user.embeddinggemma-300m-GGUF"

registry.py:297-298 docstring and hub/agents/python/chat/gaia_agent_chat/agent.py:266 comment still say "nomic embedder" — update to EmbeddingGemma.

tests/unit/test_npu_flm_embedder.py:35-38 — the parametrized test test_non_npu_uses_nomic asserts == "nomic-embed-text-v2-moe-GGUF" and will keep passing while testing the wrong value:

# before
assert get_embedding_model_for_device(device) == "nomic-embed-text-v2-moe-GGUF"

# after (import EMBEDDING_MODEL from registry or lemonade_client)
assert get_embedding_model_for_device(device) == "user.embeddinggemma-300m-GGUF"

Ovtcharov added 3 commits July 7, 2026 17:02
…mbedder

# Conflicts:
#	.github/workflows/test_embeddings.yml
#	.github/workflows/test_rag.yml
#1761 shipped the NPU FLM hardware test as tests/test_gemma_embedder_hw.py
but its workflow (test_npu_embedder.yml) and the file's own docstring both
reference tests/test_npu_flm_embedder_hw.py — so the job failed with
'file or directory not found'. Rename the file to the intended name.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🟡 code_index/sdk.py ignores the return value of ensure_model_downloaded, so a failed EmbeddingGemma registration falls silently through to load_model, giving users a confusing "model not found" error instead of an actionable message. The equivalent block in rag/sdk.py correctly checks the return value and raises a RuntimeError pointing the user to gaia init --profile rag — the code-index path should do the same.

🔍 Technical details

src/gaia/code_index/sdk.py:668 (new block, this PR):

if mr and self.config.embedding_model.startswith("user."):
    self._llm_client.ensure_model_downloaded(   # return value discarded
        self.config.embedding_model,
        checkpoint=mr.checkpoint,
        recipe=mr.recipe,
        embedding=mr.embedding,
    )

Compare to src/gaia/rag/sdk.py:502 (same PR, correct pattern):

if mr and self.config.embedding_model.startswith("user."):
    if not self.llm_client.ensure_model_downloaded(...):
        raise RuntimeError(
            f"Failed to register/download embedding model ..."
        )

Fix: mirror the rag/sdk.py guard — check not self._llm_client.ensure_model_downloaded(...) and raise a RuntimeError with a message directing the user to gaia-code index or gaia init --profile chat.

Two failures introduced on main by the #1748 (embedding cache) × #1761
(per-instance embedder) interaction and #1371 (schedule), which this branch
inherits via the merge:

1. MemoryMixin._embed_text/_get_embedder referenced self._embedding_model
   directly, which is only set in init_memory — so the embedding-cache unit
   tests (bare mixin) failed with AttributeError, and the cache key used the
   module default while the embed call used the instance model (mismatched for
   the NPU FLM embedder). Resolve the active model/dim via helpers that fall
   back to the module default, and key the cache by the same resolved model.

2. schedule/daemon.py reimported datetime inside next_fire_time (W0404) —
   already imported module-level. Removed.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🟡 The ensure_model_downloaded return value isn't checked in code_index/sdk.py — the parallel path in rag/sdk.py correctly raises a RuntimeError on failure, but code-index silently continues. If EmbeddingGemma registration fails (returns False), the code falls through to load_model, which then fails with "Could not load embedding model — Verify Lemonade Server is running" — a misleading diagnosis when the actual problem is a failed registration.

🔍 Technical details

rag/sdk.py:1147–1157 checks the return value and raises with a clear actionable message:

if not self.llm_client.ensure_model_downloaded(
    self.config.embedding_model,
    checkpoint=mr.checkpoint,
    recipe=mr.recipe,
    embedding=mr.embedding,
):
    raise RuntimeError(
        f"Failed to register/download embedding model ..."
    )

code_index/sdk.py:667–673 ignores the return value:

if mr and self.config.embedding_model.startswith("user."):
    self._llm_client.ensure_model_downloaded(   # ← return value dropped
        self.config.embedding_model,
        checkpoint=mr.checkpoint,
        recipe=mr.recipe,
        embedding=mr.embedding,
    )

Fix: mirror rag/sdk.py — guard on the return value and raise before falling through to load_model.

Ovtcharov added 2 commits July 7, 2026 17:49
Root cause of the "Server failed to start" infra failures in the api,
embeddings, and rag workflows: they launched `lemonade-server serve` inside
a Start-Job, but the `lemonade-server` shim was removed in Lemonade v10.5 —
on 10.9.0 it no longer exists, so the command failed instantly, the 60s
health poll timed out, and the finally block discarded the server output
(zero diagnostics).

Fix: route all three through the shared start-lemonade.ps1 launcher (already
used by the 5 healthy Lemonade workflows), which launches LemonadeServer.exe
with a bare --port, captures stdout/stderr to log files, waits for health,
and dumps those logs on failure. Restructure each into start → test →
always-cleanup steps so the detached server's LEMONADE_PROCESS_ID (exported
via GITHUB_ENV) is visible to the test and teardown steps, and surface the
server logs whenever model setup/verify fails.

Adds a -NoModel switch to start-lemonade.ps1 (start server only) so callers
that register a custom user-model themselves (the EmbeddingGemma embedder via
LemonadeClient) can reuse the robust launcher, and dumps server logs on a
startup timeout.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🟡 CodeIndexSDK silently swallows an embedder registration failure where RAGSDK raises — a user who hits this gets a confusing downstream load error instead of the actionable "Failed to register/download" message.

🔍 Technical details

src/gaia/code_index/sdk.py:667–673 calls ensure_model_downloaded() without checking the return value:

if mr and self.config.embedding_model.startswith("user."):
    self._llm_client.ensure_model_downloaded(   # return value discarded
        self.config.embedding_model,
        checkpoint=mr.checkpoint,
        recipe=mr.recipe,
        embedding=mr.embedding,
    )

When that returns False, execution falls through to load_model(), which fails with a generic transport error. Contrast with src/gaia/rag/sdk.py:625–636, which was updated in this same PR to raise a clear RuntimeError on failure. The fix mirrors the RAG pattern:

if mr and self.config.embedding_model.startswith("user."):
    if not self._llm_client.ensure_model_downloaded(
        self.config.embedding_model,
        checkpoint=mr.checkpoint,
        recipe=mr.recipe,
        embedding=mr.embedding,
    ):
        raise RuntimeError(
            f"Failed to register/download embedding model "
            f"{self.config.embedding_model!r}. Ensure Lemonade Server "
            f"is running, then retry (or run `gaia init --profile rag`)."
        )

…run)

Follow-up to the launcher fix. The multi-step split (start server in one
step, test in the next) failed because GitHub Actions reaps a step's child
processes at step end — the detached LemonadeServer.exe was gone by the test
step ("connection refused" on :13305). The healthy workflows (examples, npu)
run start-lemonade.ps1 + tests in a SINGLE step for exactly this reason.

Collapse the api/embeddings/rag jobs back to one step each: start-lemonade.ps1
(-NoModel) then register/verify + pytest in the same shell, with a finally
that stops the server. start-lemonade.ps1 now also sets $env:LEMONADE_PROCESS_ID
on the live process env (not just GITHUB_ENV, which only reaches later steps)
so same-step cleanup works.

The prior push already proved the launcher itself works: CI logs showed
"✅ LEMONADE SERVER READY" in ~2s where the old `lemonade-server serve` shim
timed out.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🔴 CodeIndexSDK._init_embedder() always reloads EmbeddingGemma, even when it's already running. Lemonade's /health response lists models under their stripped id (embeddinggemma-300m-GGUF), but the availability check compares against the full user.embeddinggemma-300m-GGUF — a prefix the stripped form never matches. The guard that was supposed to skip load_model for an already-running embedder is now a no-op, so every fresh CodeIndexSDK instance issues an unnecessary load_model call. This regression didn't exist with nomic-embed-text-v2-moe-GGUF (no user. prefix), and _model_ids_match was added in this PR specifically to solve this mismatch — but wasn't applied at this check.

🟡 Same function also silently drops a False return from ensure_model_downloaded, violating the fail-loudly rule. RAGSDK raises RuntimeError on that path; CodeIndexSDK proceeds silently, shifting the error to a less informative downstream failure.

🔍 Technical details

🔴 user. prefix mismatch in _init_embedder — src/gaia/code_index/sdk.py:678-679

running = [m.get("id", "") for m in health.get("all_models_loaded", [])]
if self.config.embedding_model not in running:

running holds bare ids ("embeddinggemma-300m-GGUF"); self.config.embedding_model is "user.embeddinggemma-300m-GGUF". The in test always returns False, so load_model fires unconditionally. Fix: import _model_ids_match from the same module and use it:

from gaia.llm.lemonade_client import MODELS, LemonadeClient, _model_ids_match
...
if not any(_model_ids_match(r, self.config.embedding_model) for r in running):

🟡 Silent failure on download — src/gaia/code_index/sdk.py:667-673

if mr and self.config.embedding_model.startswith("user."):
    self._llm_client.ensure_model_downloaded(...)  # return value discarded

RAGSDK raises a named RuntimeError with "Ensure Lemonade Server is running and reachable…" if this returns False. CodeIndexSDK silently continues, deferring to the load_model step where the error will be less informative. Apply the same guard here.

The RAG job reached the embeddings round-trip (server up, models pulled,
embedder registered+loaded) but failed with a raw KeyError: 'data' — a freshly
loaded embedder can briefly return a non-standard body. Retry the embeddings
call up to 5x and, on persistent failure, print the actual response instead of
a KeyError so the fault is diagnosable.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🟡 The "is it already running?" check in the code-index embedder init breaks with the new user.-prefixed model, causing an unnecessary load_model call every time the embedder is initialized (even when it's already loaded). This didn't affect the old nomic-embed-text-v2-moe-GGUF because Lemonade reported that name exactly; for user.-registered models Lemonade lists the stripped id (embeddinggemma-300m-GGUF), so the exact not in comparison never matches. The _model_ids_match helper added in this PR handles precisely this case — it just isn't used here.

🔍 Technical details

src/gaia/code_index/sdk.py lines 677-683:

running = [m.get("id", "") for m in health.get("all_models_loaded", [])]
if self.config.embedding_model not in running:
    self._llm_client.load_model(
        self.config.embedding_model,
        llamacpp_args="--ubatch-size 2048 --split-mode none",
    )

With embedding_model = "user.embeddinggemma-300m-GGUF", if the health endpoint returns entries with the stripped id "embeddinggemma-300m-GGUF" (consistent with how _model_ids_match's own docstring describes /v1/models — and with _ensure_model_loaded in lemonade_client.py needing _model_ids_match for the same health data), the check always resolves to True and load_model is called unconditionally. Because _init_embedder guards against double-init with if self._embedder is not None: return, this fires at most once per CodeIndexSDK instance; but that's still a redundant reload on an already-warm embedder.

The fix — import and apply _model_ids_match that was already added in this PR:

from gaia.llm.lemonade_client import MODELS, LemonadeClient, _model_ids_match
...
if not any(_model_ids_match(m, self.config.embedding_model) for m in running):
    self._llm_client.load_model(...)

Note: rag/sdk.py avoids the same trap by always doing unload_model + load_model (no guard), so it isn't affected.

… sticks

Root cause of the RAG/embeddings 501 'This server does not support embeddings.
Start it with --embeddings': a shared runner had embeddinggemma-300m-GGUF
already registered WITHOUT the embeddings label (stale registration from a
prior job / #1745 auto-label bug), so ensure_model_downloaded short-circuited
on 'already downloaded' and never applied the label — llama-server then loaded
the model without --embeddings.

For custom embedding models, delete any existing registration first so the
subsequent pull re-registers with embedding=True and the label is guaranteed.
Verified locally: delete + re-register + /v1/embeddings returns dim=768.
@kovtcharov-amd
kovtcharov-amd enabled auto-merge July 8, 2026 02:40
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 7b65379 Jul 8, 2026
85 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the feat/embeddinggemma-embedder branch July 8, 2026 02:41
itomek pushed a commit that referenced this pull request Jul 14, 2026
…aps (#1892)

Rebase onto main pulled in #1952's tolerant model-id matching
(_model_ids_match, stripping the user. prefix) alongside this branch's
exact-pin machinery, which still compared ids with strict equality in
three places -- _find_loaded_entry, the eval benchmark's ctx readback
probe, and (implicitly) anything built on either. Switch all three to
_model_ids_match so a user.-prefixed model id is still recognized as
loaded.

Also fixes a settle-race in _wait_model_state: get_status() swallows
probe exceptions into running=False/loaded_models=[], which the
present=False (post-unload) direction was reading as "confirmed
absent" -- letting a pinned reload proceed to /load while the server
could still be mid-teardown. A failed probe is now treated as unknown
and polled again, not as absence.

Restructures the benchmark's per-experiment error path so close_db()
runs after an ERRORED row too, not only on success, tolerating stub
agents used in tests that have no close_db.

Ports teardown hygiene (GAIA_MEMORY_DISABLED, close_db) from the
duplicate ctx-size wiring test being deleted in this same change into
its surviving counterpart, and removes the two test files that were
strict subsets of files already covering the same contract.
itomek pushed a commit that referenced this pull request Jul 14, 2026
…#1892)

An integrator (or the eval harness) previously had no REST way to see
what context window the triage model is actually loaded at -- the
readiness probe reported presence only, so a model silently loaded at
the wrong window looked identical to a correctly pinned one.

InitModelStatus gains ctx_size: the /health probe now also parses the
raw all_models_loaded[] list (entries carry model_name/checkpoint --
no id key at that layer) and, when the resolved triage model is
currently loaded, reports its recipe_options.ctx_size. Matching
tolerates the user. prefix via _model_ids_match (the third of the
three lookup sites #1952 made tolerant). Null whenever the model is
not loaded or the server does not report a ctx -- the value is always
the server's word, never a config echo.

Mirrors updated together per the doc-bundle rule: openapi.email.json
(regenerated via export_openapi), CONTRACT.md, specification.html
(InitModelStatus field table), and the npm types.ts InitModelStatus
interface (tsc --noEmit clean).
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 16, 2026
Cuts the **v0.22.0** minor release on top of v0.21.2 — 198 commits, 62
of them `feat`, built around the email agent. It grows past triage: it
now keeps track of the mail you're waiting on and the things you said
you'd do, can send and snooze on a schedule, drafts replies that sound
like you (derived style only — never your Sent content), and handles
attachments. In the Agent UI, email moved out of the main process — you
install it from the Agent Hub and it runs as its own isolated sidecar.

Away from email: **`gaia schedule`** brings cron dispatch to the CLI (no
UI in the loop), agents start **distilling procedures from work they
repeat**, RAG **reads Word documents**, and `gaia config set
default_model` ends re-typing `--model`. The **default embedder**
changes to EmbeddingGemma 300M — quieter than it sounds, because the old
default can't be loaded by current llama.cpp builds at all, which
silently broke document indexing, code search, and memory.

**Two breaking changes** are called out up front: triage's `draft.body`
is gone (it was always `""`; it's a `DraftScaffold` now), and
RoutingAgent / DocumentQAAgent moved to standalone wheels with no
deprecation shim.

The email agent is marked **beta** throughout, and the notes carry a
short **Known issues** section naming two open bugs found while
validating this release (amd#2124, amd#2127) rather than leaving users to
discover them.

## Evidence

Claims in the notes were verified against `origin/main` @ `5265b96a` (a
pristine detached checkout, not a dirty tree), on macOS + Ubuntu 24.04 +
Windows 11, all running the pinned **Lemonade 10.10.0**.

<details>
<summary>What was exercised, and what it showed</summary>

| Claim | Evidence |
|---|---|
| Triage returns a scaffold, no `draft.body` | Live `POST
/v1/email/triage` → HTTP 200, `draft` = `['subject','to']`,
`schema_version 2.4`. Confirmed on Ubuntu + macOS, and in the published
`openapi.email.json` |
| `.docx` indexing (tables, nested tables, content controls, hyperlinks,
textboxes) | All 6 planted facts extracted verbatim (`Zephyr`, `APAC
8610`, `violet-otter-92`, `quartz-badger-40`, `cobalt-lynx-77`, `desk
17C`); legacy `.doc` rejected loudly |
| `gaia schedule` cron + sinks | `~/.gaia/schedules.toml` written; sinks
`stdout \| file:<path> \| notification \| telegram`; verified on macOS +
Ubuntu |
| `gaia config set default_model` | Persists + reads back; corrupt
config fails loudly naming the file |
| Email runs as its own process in the Agent UI | Typed a message in a
real Agent UI email chat → sidecar spawned: `email-agent --host
127.0.0.1 --port 59026`, health-checked, `apiVersion=2.3`;
`GAIA_EMAIL_AGENT_MODE` unset, `gaia_agent_email` not pip-installed |
| Binary is integrity-checked | Fresh Hub install (uninstall → install
from the panel); recorded `artifact_sha256` matches the on-disk binary
exactly; log: `using hub-installed verified binary` |
| Lemonade 10.10.0 note: re-run `systemctl --user enable lemond` |
Verified live — after the 10.7.0→10.10.0 upgrade on Ubuntu, `systemctl
--user is-enabled lemond` returned `disabled` |

Claims that could **not** be measured were rewritten rather than
asserted: no performance number is quoted for the embedder work (none of
amd#1952/amd#1761/amd#1748 has a measured before/after), and the NPU entry
describes the mechanism instead of claiming the load/unload loop is
fixed (amd#1676 is still open).

Two spam metrics from a PR body (0.807 recall / 0.677 precision)
contradicted the committed baseline
(`tests/fixtures/email/baseline_accuracy.json`: 0.7719 / 0.6567) and
were dropped along with the whole spam claim — see amd#2124.
</details>

## Release checklist
- [x] `util/validate_release_notes.py docs/releases/v0.22.0.mdx --tag
v0.22.0` passes
- [x] `src/gaia/version.py` → `0.22.0`
- [x] `src/gaia/apps/webui/package.json` → `0.22.0`
- [x] `src/gaia/apps/webui/package-lock.json` → `0.22.0`
- [x] Navbar label in `docs/docs.json` → `v0.22.0 · Lemonade 10.10.0`
(was drifted at `10.7.0`)
- [x] All 198 commits in range (`v0.21.2..HEAD`) represented in the
notes
- [x] Community contributors credited (@alexey-tyurin, @TravisHaa,
@Rohithmatham12, @Osamaali313, @eeee2345, @somo9909)
- [ ] Review from @kovtcharov-amd addressed
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Aug 17, 2026
Release notes had grown into long blocks of prose with a marketing-toned
paragraph on top. They now generate as short bullets grouped by section,
with a word cap on the narrative part. Nothing informational is lost —
every PR link, contributor credit, and changelog entry is preserved; the
prose around them is cut.

Two generators write `docs/releases/<tag>.mdx` and they had drifted
apart. The `gaia-release` skill told the model GAIA's notes "read dry"
and to make them "engaging"; the `release-notes` job in `claude.yml`
asked for "comprehensive" notes with an `## Overview` paragraph and
emoji headings. Fixing one alone would have been overwritten by the
other on the next tag, so both now share one spec.

Closes amd#2961

## What it looks like now

Regenerated from the last two releases — same facts, same PR numbers,
new template. Narrative words (the capped part, excluding
bug-fix/contributor/changelog lists):

| Release | Published | Regenerated | Cap |
|---|---|---|---|
| v0.22.0 (minor) | 1705 | **538** | 600 |
| v0.23.0 (minor) | 1119 | **280** | 600 |

<details>
<summary>Example 1 — v0.23.0 regenerated</summary>

```markdown
---
title: "v0.23.0"
description: "Install and run agents from the terminal, add capabilities as skills, and connect a Microsoft account without a secret."
---

# GAIA v0.23.0 Release Notes

Agents are now installable from the terminal, and the confirmation gate that pauses an agent before a consequential action works everywhere, not just in the Agent UI.

## Breaking Changes

- **`GAIA_MICROSOFT_TENANT` is gone** — the Microsoft connector split into Personal and Work/School, each with its own tenant. Drop the variable and pick the matching connector. (PR [amd#2729](amd#2729))

## What's New

- **Install and run agents from the terminal** — `gaia hub list`, `gaia hub install <agent> --trust`, `gaia hub uninstall <agent>`. `--trust` is required for an unverified agent. (PRs [amd#2484](amd#2484), [amd#2530](amd#2530), [amd#2708](amd#2708))
- **Every agent asks before it acts** — the confirmation gate for sending mail, writing files, and running commands now fires from the terminal, the local API, and MCP tool calls, not only the Agent UI. Set `GAIA_AUTO_APPROVE_TOOLS=1` to opt out. (PRs [amd#2475](amd#2475), [amd#2544](amd#2544), [amd#2846](amd#2846), [amd#2854](amd#2854))
- **Safer by default** — the MCP bridge binds to localhost and enforces `--auth-token`; the local API refuses credentialed cross-origin requests from non-allow-listed sites; MCP servers launch without a shell; agents cannot write to `~/.gaia` or pass crafted SQL to the database agent. (PRs [amd#2246](amd#2246), [amd#2238](amd#2238), [amd#2344](amd#2344), [amd#2844](amd#2844), [amd#2847](amd#2847), [amd#2860](amd#2860))
- **Add capabilities as skills** — `gaia skill create|import|list|info` gives an agent a new capability from a folder and a manifest. Skills are signed with trust tiers, audited before publish, and opt-in. (PRs [amd#2669](amd#2669), [amd#2692](amd#2692), [amd#2702](amd#2702), [amd#2693](amd#2693))
- **Connect a Microsoft account without a secret** — Personal and Work/School are separate connectors with device-code sign-in. (PRs [amd#2718](amd#2718), [amd#2364](amd#2364))
- **Lemonade Server 11.5.0.**

## Bug Fixes

- **Triage paginates large inboxes and reports truncation** (PR [amd#2646](amd#2646)) — mail past a hidden limit is no longer dropped without saying so.
- **Thread messages come back sorted and numbered** (PR [amd#2570](amd#2570)) — "reply to 3" hits the message shown at position 3.
- **The inbox pre-scan reports uncertainty as uncertainty** (PR [amd#2587](amd#2587)).
- **An email conversation survives its turns** (PR [amd#2837](amd#2837)) — a follow-up keeps session context.
- **A bare reconnect keeps existing grants** (PR [amd#2733](amd#2733)).
- **Restore from Trash anytime** (PR [amd#2542](amd#2542)) — no time window on undo.
- **Sender priority no longer overrides content classification** (PR [amd#2774](amd#2774)).
- **The agent survives an OpenMP double-init** (PR [amd#2508](amd#2508)).
- **Large tool results truncate to valid JSON** (PR [amd#2645](amd#2645)).
- **A missing model surfaces as a real 404** (PR [amd#2245](amd#2245)).
- **GPU is detected on all platforms and `default_device` is honoured** (PR [amd#2244](amd#2244)).
- **A sidecar that is alive but not serving is detected** (PR [amd#2707](amd#2707)).
- **The model-slot lease is held across inference** (PR [amd#2394](amd#2394)) — a second agent can't evict the model mid-generation.
- **A browser that never launched is surfaced** (PR [amd#2507](amd#2507)).
- **Stop aborts in-flight streaming** (PR [amd#2166](amd#2166)).

## Known Issues

- **The email agent is beta and CLI-first** — treat its output as a draft to review.
- **A full inbox triage can time out on larger mailboxes.**
- **Email autonomy is experimental** and not wired up in the packaged sidecar.

## Contributors

- [@handle](https://github.com/handle) — <contribution> (PR [#NNN](https://github.com/amd/gaia/pull/NNN))
  <!-- generated from the commit log; v0.23.0's list is unchanged from the published notes -->


## Full Changelog

**N commits** since v0.22.0:

- `<sha>` — <subject>

Full Changelog: [v0.22.0...v0.23.0](amd/gaia@v0.22.0...v0.23.0)
```
</details>

<details>
<summary>Example 2 — v0.22.0 regenerated (the largest recent
release)</summary>

```markdown
---
title: "v0.22.0"
description: "The email agent tracks follow-ups and action items, drafts in your voice, and runs as its own process. Plus a cron scheduler and Word document support in RAG."
---

# GAIA v0.22.0 Release Notes

A large release built around the email agent, which now tracks what you're waiting on instead of forgetting it after triage.

## Breaking Changes

- **Triage returns a reply scaffold, not an empty draft** — `POST /v1/email/triage` and `/triage/batch` now return a `DraftScaffold` without `body`. Code reading `result.draft.body` gets a missing key instead of `""`; use `POST /v1/email/draft` for composed prose. (PR [amd#1984](amd#1984))
- **RoutingAgent and DocumentQAAgent moved to standalone packages** — install `gaia-agent-routing` and `gaia-agent-docqa`. The old imports fail; there is no deprecation shim. (PR [amd#1455](amd#1455))

## What's New

- **An inbox agent that keeps track** — `gaia email` scans Sent folders across every connected mailbox and flags threads still waiting on a reply past a window you set (default 3 days). Detection only; it never nudges anyone for you. (PRs [amd#1922](amd#1922), [amd#1917](amd#1917), [amd#1919](amd#1919), [amd#1918](amd#1918))
- **Drafts in your own voice** — the agent derives greeting, sign-off, length, and formality from your Sent history and composes against that. Only the derived characteristics are stored, never old mail content. (PR [amd#1925](amd#1925))
- **Attachments work end to end** — triage surfaces each attachment's name, type, and size, and drafting and sending accept real attachments as Gmail multipart MIME or Outlook Graph attachments. (PRs [amd#1921](amd#1921), [amd#1883](amd#1883))
- **Email runs as its own process in the Agent UI (beta)** — install it from the Agent Hub panel and the UI talks to it over HTTP, instead of loading the email stack into the UI process. (PRs [amd#1884](amd#1884), [amd#1910](amd#1910), [amd#2100](amd#2100), [amd#2101](amd#2101), [amd#2105](amd#2105))
- **Run prompts on a cron from the terminal** — `gaia schedule add --name digest --cron "0 9 * * *" --prompt "summarize my inbox" --sink stdout`, then `gaia schedule daemon`. Schedules live in a hand-editable `~/.gaia/schedules.toml`; sinks are `stdout`, `file:<path>`, `notification`, or `telegram`. (PR [amd#1371](amd#1371))
- **Agents learn from work they repeat** — after enough successes on the same shape of goal, an agent distills the tool sequence into a reusable procedure and recalls it next time. Runs inside the existing memory pass; nothing to install. (PR [amd#1794](amd#1794))
- **Pick your model once** — `gaia config set default_model <id>` persists across `gaia chat`, `gaia llm`, and `gaia prompt`. An explicit `--model` still wins for a one-off. (PR [amd#1863](amd#1863))
- **RAG reads Word documents** — `.docx` files index like PDF and PPTX, including table cells, nested tables, content controls, hyperlinks, and textboxes, so filled-in form values get indexed. (PR [amd#1866](amd#1866))
- **A new default embedder** — the previous default cannot be loaded by current llama.cpp builds, which broke indexing, code search, and memory embedding on an up-to-date Lemonade. The default is now EmbeddingGemma 300M at the same 768 dimensions. (PRs [amd#1952](amd#1952), [amd#1761](amd#1761), [amd#1748](amd#1748))
- **The Agent Hub shows what an agent is worth** — an agent's page now carries its eval scorecard with a score badge and a code-derived capability matrix. (PRs [amd#1985](amd#1985), [amd#2020](amd#2020), [amd#2066](amd#2066))
- **Lemonade Server 10.10.0** — adds an audio-generation endpoint, lets Windows reuse system ROCm, and inhibits suspend during inference. Two upstream breaking changes are Linux-specific. (PR [amd#1969](amd#1969))

## Bug Fixes

- **`gaia init` said a working Lemonade wasn't installed** (PR [amd#1940](amd#1940)) — modern Lemonade (10.7+) dropped the `lemonade-server` CLI that GAIA probed for.
- **Installing the email agent from the Hub failed on every platform** (PR [amd#2086](amd#2086)).
- **Bulk triage broke on any real inbox** (PR [amd#2088](amd#2088)) — 60 emails overflowed the 16K context window; the result envelope is now condensed.
- **RAG silently indexed nothing** (PR [amd#1979](amd#1979)) — a failed `sentence-transformers` import made every indexing call a no-op.
- **Email bodies were truncated at 4,000 characters with no override** (PR [amd#2036](amd#2036)) — MFA codes and precise replies lost content past the cutoff.
- **Long threads overflowed the model's context** (PR [amd#2076](amd#2076)).
- **A disabled device was treated as usable** (PR [amd#2081](amd#2081)) — a device reporting `available: false`, such as an unpowered NPU, was misread as ready.
- **A newly connected mailbox was skipped** (PR [amd#1808](amd#1808)) — mailboxes connected mid-session were not picked up.
- **JSON with a `}` inside a string was dropped** (PR [amd#1824](amd#1824)).
- **Outlook users were told to reconnect Google** (PR [amd#1757](amd#1757)) — `AGENT_NOT_GRANTED` named the wrong provider.
- **The Agent UI hard-crashed on a recoverable GPU crash** (PR [amd#1799](amd#1799)) — it now falls back to software rendering.
- **A user-edited memory could be silently downgraded and then wiped** (PR [amd#1958](amd#1958)).
- **The builder agent ignored an agent name you had already given** (PR [amd#1981](amd#1981)).
- **The landing and hub pages scrolled sideways on phones** (PR [amd#1959](amd#1959)).

## Known Issues

- **Inbox pre-scan needs a single mailbox for now** — with both Gmail and Outlook connected, an Agent UI pre-scan errors. Disconnect one in Settings → Connectors; triage itself still spans every mailbox. ([amd#2127](amd#2127))
- **Spam detection under-flags over the REST API** — `/v1/email/triage` uses a narrow sender check rather than the model's reading. The agent's own inbox scanning is unaffected. ([amd#2124](amd#2124))
- **The email agent is beta** — treat its output as a draft to review. It never sends without your confirmation.

## Contributors

- [@alexey-tyurin](https://github.com/alexey-tyurin) — skill auto-synthesis / procedural memory (PR [amd#1794](amd#1794))
- [@TravisHaa](https://github.com/TravisHaa) — the `gaia schedule` CLI and cron-based dispatch (PR [amd#1371](amd#1371))
- [@Rohithmatham12](https://github.com/Rohithmatham12) — refresh resolved email backends before multi-mailbox triage (PR [amd#1808](amd#1808))
- [@Osamaali313](https://github.com/Osamaali313) — fix `extract_json_from_text` dropping JSON containing `}` (PR [amd#1824](amd#1824))
- [@eeee2345](https://github.com/eeee2345) — offline model-endpoint guard-proxy integration guide (PR [amd#1809](amd#1809))
- [@somo9909](https://github.com/somo9909) — prerequisites section for the memory guide (PR [amd#1665](amd#1665))

## Full Changelog

**N commits** since v0.21.2:

- `<sha>` — <subject>

Full Changelog: [v0.21.2...v0.22.0](amd/gaia@v0.21.2...v0.22.0)
```
</details>

<details>
<summary>What changed in the templates</summary>

- The narrative overview paragraph and the `**Why upgrade:**` block are
gone — the latter restated `What's New` verbatim.
- `What's New` entries are bullets, not `###` prose blocks.
- Tone guidance is no longer restated in the skill; it points at
CLAUDE.md § How You Communicate.
- The skill's embedded example now shows the old prose block as **bad**
and the bullet form as **good**.
- Emoji removed from the CI prompt (it asked for 🚀 / 🎯 / 🐛 headings
against the skill's own no-emoji rule).
- Both generators now emit the same sections in the same order, so the
file's shape no longer depends on which one ran.
- The cap excludes `Bug Fixes` / `Known Issues` / `Contributors` / `Full
Changelog`. Those are reference lists sized by how many fixes shipped —
capping them would hide work. This was caught by regenerating v0.22.0,
which overflowed a whole-file cap purely on its 14 bug-fix bullets.

**Follow-up, not in this PR:** the cap lives in prompt text, so it is
advisory. Making it a hard check in `util/validate_release_notes.py`
would enforce it in CI.
</details>

## Test plan

- [ ] `python util/validate_release_notes.py <regenerated sample> --tag
v0.23.0` exits 0 — passes unmodified, no validator changes in this PR
- [ ] `awk '/^## (Bug Fixes|Known Issues|Contributors|Full
Changelog)/{exit} {print}' <file> | wc -w` is under 350 (patch) / 600
(minor-major)
- [ ] `.github/workflows/claude.yml` parses as valid YAML and its
release-notes prompt contains no emoji
- [ ] `.claude/skills/gaia-release/SKILL.md` is under 500 lines (498)
- [ ] Both generators list the same sections in the same order
kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Sep 29, 2026
…emory (amd#4489)

Stale `nomic-embed-text` references outlived the switch to
EmbeddingGemma (amd#1952), and nomic crashes llama.cpp on Vulkan (amd#1831).
This removes them everywhere except where there's a reason to keep them
(listed below), and closes a gap where memory from before July 2026 kept
its nomic vectors and mixed them with EmbeddingGemma queries, quietly
degrading recall.

- **Legacy memory is now re-embedded.** Memory written before the
embedder was stamped holds nomic vectors with no marker, and startup
kept them. A missing marker now counts as an embedder change: vectors
are cleared with a logged warning and backfill re-embeds them. The
dashboard's rebuild button goes through the same path.
- **One live test was always skipping.** The code-index eviction test
loaded nomic as the competing embedder, which current Lemonade can't do.
It now evicts by unloading, so it actually runs.
- **Pairs with amd#4459**, which fixes the agent-registry default (the
fresh-install bug itself). The registry, the chat/email agent comments
and the registry tests are left to that PR to avoid conflicts. Once both
merge, the only nomic references left are the ones below.

**Kept on purpose:**
- `docs/releases/*`: release notes record what shipped.
- Migration notes in the memory SDK doc, memory spec and code-index
guide, plus the tests that seed a nomic-stamped store: they describe and
pin the upgrade path for existing users.
- `eval/results/phase2/scorecard.json` and
`eval/scenarios/memory/memory_journaling_report.py`: captured outputs of
past runs. Editing them would misstate what ran.
- `docs/plans/gaia-agent-latency.md` (captured `lemonade` output) and
`docs/plans/tool-loader.mdx` ("τ was calibrated against live nomic
embeddings"): they record past measurements. The second is also a real
caveat, because τ hasn't been re-checked against EmbeddingGemma.

RAG and code-index needed no migration. The RAG disk cache stores only
text and chunks, and a code index built with nomic already fails loudly
with a model-mismatch error. Retrieval for fresh installs is unchanged
(same default embedder), so no `rag_quality` eval was run.

## Test plan
- [x] `pytest` on the memory, memory-router, embedder, RAG-cache,
broker, stdio and email-wiring suites: 1422 passed. The one failure
(`test_memory_discovery` Outlook registry) fails identically on
`origin/main` on this machine.
- [x] `python util/lint.py --all`: black, isort, flake8 and bandit pass.
The two pylint errors (`os.getuid`, `signal.SIGKILL`) are Windows-only
and pre-existing.
- [ ] `build_cpp.yml` CI: the C++ vector-index tests only swap a string
literal, and there is no C++ toolchain on the machine this was written
on.
- [ ] Upgrade path: start the agent against a `memory.db` from before
July 2026 (no `embedder_id` in `meta`). Expect one `embedder changed
(unrecorded, pre-2026-07 memory -> user.embeddinggemma-300m-GGUF)`
warning and full embedding coverage afterwards.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent::emr Medical-intake (EMR) agent changes agents cpp devops DevOps/infrastructure changes documentation Documentation changes installer Installer changes llm LLM backend changes performance Performance-critical changes rag RAG system changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants