Skip to content

Add DocumentDB Search: embedding-backed vector search - #1

Merged
xgerman merged 1 commit into
mainfrom
geeichbe/documentdb-search-vector
Jul 17, 2026
Merged

Add DocumentDB Search: embedding-backed vector search#1
xgerman merged 1 commit into
mainfrom
geeichbe/documentdb-search-vector

Conversation

@xgerman

@xgerman xgerman commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Adds DocumentDB Search — embedding-backed semantic recall for the knowledge-graph search_nodes tool.

  • Pluggable embedding provider: Ollama/local (default), OpenAI, Azure OpenAI.
  • Entities are embedded on write and indexed via DocumentDB's native cosmosSearch vector index.
  • search_nodes fuses keyword ($text) and vector kNN results with reciprocal-rank fusion (RRF).
  • Graceful degradation: no embedder / unreachable backend / vector-query failure ⇒ keyword-only search, entities still stored. Keeps drop-in compatibility with the upstream @modelcontextprotocol/server-memory.
  • compose.full.yml now bundles an ollama service + one-shot model pull, so the default local provider works out of the box.
  • New documentdb-memory graph reembed [--all] CLI command backfills existing entities.

Verification

  • 124 unit/storage tests pass; typecheck, lint, build clean.
  • Live end-to-end against real DocumentDB: cosmosSearch index created, hybrid search returns a vector-only hit (k8sKubernetes) that keyword search misses.
  • Compose stack verified: ollama healthy, model pulled, MCP server logs embeddings: DocumentDB Search enabled (nomic-embed-text, 768 dims).

Docs

README (DocumentDB Search section), docs/architecture.md, docs/cli.md, .env.example all updated.

Adds semantic recall to the knowledge-graph search_nodes tool via a
pluggable embedding provider (Ollama/local default, OpenAI, Azure
OpenAI) and DocumentDB's native cosmosSearch vector index. Keyword and
vector results are fused with reciprocal-rank fusion; when no embedder
is configured or reachable, search degrades gracefully to keyword-only,
preserving drop-in compatibility with the upstream memory server.

Bundles an ollama service (plus a one-shot model pull) in
compose.full.yml so the default local provider works out of the box,
and adds a `graph reembed` CLI command to backfill existing entities.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5828340b-8673-4585-9761-9b6bc4d8faca
Signed-off-by: German Eichberger <geeichbe@microsoft.com>
@xgerman
xgerman merged commit fcd0c9c into main Jul 17, 2026
1 check passed
@xgerman
xgerman deleted the geeichbe/documentdb-search-vector branch July 17, 2026 16:07
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.

1 participant