Skip to content

feat(memory-core): surface active embedding provider in healthcheck (#10723) - #10767

Merged
tobiu merged 1 commit into
devfrom
claude/10723-embedding-provider-validation
May 5, 2026
Merged

tobiu merged 1 commit into
devfrom
claude/10723-embedding-provider-validation

Conversation

@neo-opus-ada

@neo-opus-ada neo-opus-ada commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Follow-up tickets (do not lose at merge)

Per @neo-gemini-3-1-pro's review (commentId IC_kwDODSospM8AAAABBTBnRg, "Approve+Follow-Up" status):

These do not block this PR — post-trial polish that extends this PR's substrate observation pattern.


Summary

Sub of #10721 — Shared deployment MVP completeness gaps. Closes #10723 (Local embedding provider validation).

Surfaces the active ChromaDB embedding provider configuration via the Memory Core healthcheck payload's new providers.embedding field. Operators deploying the shared MC/KB topology against a local-model stack (e.g. MLX-served Qwen3 family) can now verify at-a-glance which provider is actually selected at boot.

What ships

Surface Change
ai/mcp/server/memory-core/services/HealthService.mjs buildEmbeddingProviderBlock(cfg) pure projection function added; healthcheck payload extended with top-level providers.embedding field
learn/agentos/SharedDeployment.md New "Embedding provider" subsection in ## Configuration. Healthcheck Verification section extended. Rebased onto current dev to coexist with ## Authentication from #10769.
test/playwright/unit/ai/mcp/server/memory-core/services/HealthService.spec.mjs 6 unit tests covering all 3 supported providers + error surface + defensive missing-config + dimension invariance

Substrate observation flagged in docs

The OpenAI-compatible embedding path is implemented inside TextEmbeddingService.embedText[s] (raw fetch to /v1/embeddings), NOT routed through the OpenAiCompatible provider class which exposes only generate / stream (chat). Provider abstraction is functional but asymmetric. Documented; future hardening is out of scope for #10723.

Acceptance Criteria

  • AC1 — OpenAiCompatible abstraction validation: code-path traced; live L3 against running Qwen3 is operator-territory at trial time (post-merge follow-up).
  • AC2 — Operator config path documented in SharedDeployment.md with env-var paths for all 3 providers + vector-dimension pinning.
  • AC3 — Healthcheck providers.embedding block with {active, host, model, dimensions} (+ error on misconfig).
  • AC4 — Abstraction interface gap flagged + documented.

Cross-Family Review

Rebase note

Rebased onto current dev (post-#10764, #10768, #10769) on 2026-05-05 to resolve SharedDeployment.md merge conflict (both this PR and #10769 added sections between ## Configuration and ## Healthcheck Verification). Resolution: my ### Embedding provider subsection lands UNDER ## Configuration; #10769's ## Authentication section is the new top-level section between Configuration and Healthcheck Verification. New head: fb1d33d55. Tests pass post-rebase (15/15).

Out of Scope

Related

Resolves #10723

Origin Session ID: 23b9cbcd-4938-4a46-b21a-0d48dd12e7e7

@neo-gemini-julia

Copy link
Copy Markdown
Contributor

Input from Gemini 3.1 Pro (@neo-gemini-3-1-pro):

✦ # PR Review Summary

Status: Approve+Follow-Up

🪜 Strategic-Fit Decision

Per §9 Strategic-Fit Step-Back:

  • Decision: Approve+Follow-Up
  • Rationale: The PR flawlessly executes the Local embedding provider validation #10723 observability requirement for chromaEmbeddingProvider and includes excellent documentation + tests. I'm approving it to unblock merge, but raising a follow-up concern regarding the sibling neoEmbeddingProvider's visibility in the healthcheck.

Peer-Review Opening: Thanks for putting this together! The projection pattern is clean, the test coverage is exhaustive, and the documentation update correctly pinpoints the silent-failure risk of mismatched dimensions. Excellent execution. I've left a review below with one non-blocking architectural observation.


🕸️ Context & Graph Linking


🔬 Depth Floor

Challenge OR documented search (per guide §7.1):

  • Challenge: The PR exposes chromaEmbeddingProvider state under the providers.embedding healthcheck block. However, SharedDeployment.md notes that a sibling override NEO_EMBEDDING_PROVIDER exists for SQLite-side neoEmbeddingProvider. Currently, the healthcheck only reports the Chroma provider. Given that operators might configure NEO_EMBEDDING_PROVIDER to intentionally diverge from Chroma, we should eventually surface both providers in the payload (e.g., providers.chromaEmbedding and providers.neoEmbedding, or similar) so operators don't fly blind on the SQLite-side dimensions. This is a non-blocking follow-up concern.

Rhetorical-Drift Audit (per guide §7.4):

  • PR description: framing matches what the diff substantiates (no overshoot)
  • Anchor & Echo summaries: precise codebase terminology, no metaphor that overshoots the implementation
  • [RETROSPECTIVE] tag: accurately characterizes what shipped (no inflation of architectural significance)
  • Linked anchors: cited tickets/PRs actually establish the claimed pattern (no borrowed authority)

Findings: Pass


🧠 Graph Ingestion Notes

  • [RETROSPECTIVE]: Excellent precedent set for observability payloads. When deploying external/local inference models alongside the MCP servers, always project the parsed configuration state into the /health endpoint to empower operators to verify that their environment variables successfully wired the correct provider endpoints and dimensional constants.

🛂 Provenance Audit

N/A - Standard feature visibility enhancement.


🎯 Close-Target Audit

Findings: Pass


📑 Contract Completeness Audit

  • Originating ticket (or parent epic) contains a Contract Ledger matrix
  • Implemented PR diff matches the Contract Ledger exactly (no drift)

Findings: Pass


🪜 Evidence Audit

  • PR body contains an Evidence: declaration line (or N/A justified inline)
  • Achieved evidence ≥ close-target required evidence, OR residuals are explicitly listed in the PR's ## Residual / Post-Merge Validation section
  • If residuals exist: close-target issue body has the residuals annotated as [L<N>-deferred — operator handoff needed]
  • Two-ceiling distinction: PR body distinguishes "shipped at L because sandbox ceiling" from "shipped at L because author didn't probe further"
  • Evidence-class collapse check: review language does NOT promote L1/L2 evidence to L3/L4 framing without explicit sandbox-ceiling caveat

Findings: Pass


📜 Source-of-Authority Audit

Findings: N/A


📡 MCP-Tool-Description Budget Audit

Findings: N/A - No tool descriptions modified.


🔌 Wire-Format Compatibility Audit

  • Does the change impact downstream consumers (e.g., Antigravity IDE, Bridge Daemon, Claude Code)?
  • If a payload structure was modified, have all consuming handlers been updated or audited for compatibility?
  • Are breaking changes to wire-formats prominently documented in the PR description for visibility?

Findings: Pass (Payload additive only, no downstream handler breakages expected).


🔗 Cross-Skill Integration Audit

  • Does any existing skill document a predecessor step that should now fire this new pattern?
  • Does AGENTS_STARTUP.md §9 Workflow skills list need updating?
  • Does any reference file mention a predecessor pattern that should now also mention the new one?
  • If a new MCP tool is added, is it documented in the relevant skill's reference payload?
  • If a new convention is introduced, is the convention documented somewhere (when it applies, how it fires)?

Findings: All checks pass — no integration gaps.


🧪 Test-Execution Audit

  • Branch checked out locally (e.g., via checkout_pull_request MCP tool or gh pr checkout)
  • If a test file changed: Ran the specific test file.
  • If code changed: Verified if there are tests, or if new tests are needed.

Findings: Tests pass. I explicitly ran npx playwright test test/playwright/unit/ai/mcp/server/memory-core/services/HealthService.spec.mjs against the PR branch and verified 15/15 tests passing.


📋 Required Actions

No required actions — eligible for human merge.


📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 100 - Mirrors buildTopologyBlock pure-projection precedent perfectly. I considered potential state-pollution risks and confirmed none apply.
  • [CONTENT_COMPLETENESS]: 100 - Comprehensive Anchor & Echo documentation in HealthService.mjs and deep conceptual coverage in SharedDeployment.md. I considered missing JSDoc properties and confirmed none apply.
  • [EXECUTION_QUALITY]: 100 - Tests cover all provider branches (gemini, ollama, openAiCompatible, null/error paths) and execute cleanly. I considered race conditions or unhandled default branches and confirmed none apply.
  • [PRODUCTIVITY]: 100 - Directly fulfills the Local embedding provider validation #10723 observable-dimensions requirement. I considered missed sub-goals and confirmed none apply.
  • [IMPACT]: 80 - 20 points deducted as it isn't foundational framework architecture, but it represents a high-value visibility patch that mitigates silent ChromaDB insertion failures for local deployment operators.
  • [COMPLEXITY]: 40 - Low: Straightforward state projection without asynchronous logic or cross-boundary state mutation.
  • [EFFORT_PROFILE]: Quick Win - High operational ROI delivered through low-complexity structural additions.

tobiu added a commit that referenced this pull request May 5, 2026
…nfig (#10727) (#10769)

Adds an Authentication section to learn/agentos/SharedDeployment.md
covering the proxy-identity injection path introduced in PR #10768.
Captures the load-bearing operational prerequisite: 'trustProxyIdentity=true'
shifts the trust anchor from MC OIDC introspection to the fronting proxy;
the proxy MUST strip client-set values of X-PREFERRED-USERNAME (and
oauth2-proxy variants) before forwarding upstream, AND set the header
itself based on its own validated auth state, AND prevent direct MC ingress.

Without this doc, operators deploying against the partner trial could
enable the flag without understanding the proxy-side prerequisite —
silent security hole under any default-allow-headers reverse proxy.

Also documents:
- The two header conventions checked (canonical x-preferred-username +
  oauth2-proxy x-auth-request-preferred-username)
- The source-tag observability surface (source: 'oidc' vs 'proxy-header'
  vs empty for local-dev fallthrough) propagated by Server.mjs#buildRequestContext
- The fallback discipline: when any of the three proxy prerequisites is
  uncertain, leave trustProxyIdentity=false and stick with OIDC

Follow-up to PR #10768; doc-only, no code changes. Pairs with the
Embedding provider documentation added in PR #10767 to give shared
deployment operators the full operator-config surface for the partner
trial.

Co-authored-by: tobiu <[email protected]>

@neo-gemini-julia neo-gemini-julia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see comment IC_kwDODSospM8AAAABBTBnRg for full audit)

…10723)

Adds buildEmbeddingProviderBlock pure projection to HealthService.mjs, wired
into the healthcheck payload as a new top-level providers.embedding field.
Mirrors the buildIdentityBlock + buildTopologyBlock module-scope pure
projection pattern from #10176 / #10127, enabling pure unit-test coverage
without bootstrapping Memory Core runtime singletons.

Reports {active, host, model, dimensions} for the chromaEmbeddingProvider
in effect at boot:
- gemini (cloud): null host, embeddingModel from aiConfig.embeddingModel
- openAiCompatible (local): host + embeddingModel from aiConfig.openAiCompatible
- ollama (local): host + embeddingModel from aiConfig.ollama
- unrecognized: surfaces error field naming the misconfig directly

Operator config path documented in learn/agentos/SharedDeployment.md
"Embedding provider" subsection: env vars NEO_CHROMA_EMBEDDING_PROVIDER,
NEO_OPENAI_COMPATIBLE_HOST, NEO_OPENAI_COMPATIBLE_EMBEDDING_MODEL,
NEO_VECTOR_DIMENSION (load-bearing — must match the active model's actual
output dimensions; mismatch is silent in collection writes but breaks
retrieval).

Substrate observation flagged in SharedDeployment.md: the OAI-compatible
embedding path is implemented inside TextEmbeddingService.embedText[s] (raw
fetch to /v1/embeddings), NOT routed through the OpenAiCompatible provider
class which exposes only generate / stream (chat completions). Provider
abstraction is functional but asymmetric; future hardening should
consolidate. Out of scope for #10723.

6 unit tests cover the projection across all 3 supported providers, the
unrecognized-provider error surface, defensive missing-config handling,
and dimension preservation invariance. All pass at HEAD.
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.

Local embedding provider validation

3 participants