Repository navigation
feat(mcp): activate configurable provider and model reranking - #1949
Open
abouchard11 wants to merge 7 commits into
Open
abouchard11 wants to merge 7 commits into
abouchard11 wants to merge 7 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
An empty LLM provider entry can mask valid embedder credentials and cause startup failure.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds configurable reranking to MCP searches while preserving default RRF behavior.
Changes:
- Adds explicit reranker provider and model selection.
- Enables independent fact and node reranking, preserving centered-search behavior.
- Documents configuration and adds factory and search-pipeline tests.
| File | Description |
|---|---|
| mcp_server/tests/test_search_reranker_config.py | Tests recipe selection and reranker invocation. |
| mcp_server/tests/test_cross_encoder_factory.py | Tests provider/model selection and service wiring. |
| mcp_server/src/services/factories.py | Constructs explicitly configured rerankers. |
| mcp_server/src/graphiti_mcp_server.py | Applies configured search recipes and request limits. |
| mcp_server/src/config/schema.py | Defines reranker and search-strategy settings. |
| mcp_server/README.md | Documents configuration and environment overrides. |
| mcp_server/config/config.yaml | Supplies backward-compatible defaults. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
An explicitly selected reranker used the first matching provider entry,
LLM before embedder, as soon as it existed. An unset ${VAR} leaves an
entry with api_key=None, so an empty LLM entry hid a configured embedder
entry and startup failed with a missing-key error. Try entries with a key
first, keeping LLM-before-embedder order; keyless entries remain a
fallback for clients that read the key from the environment.
Also cover the remaining explicit paths: local bge, Azure's v1 endpoint
with a model override, and the startup error when no entry matches.
The Docker images load the config-docker-*.yaml files, which had no reranker block or search recipe keys, so RERANKER_PROVIDER, RERANKER_MODEL, FACT_RERANKER, and NODE_RERANKER were silently ignored there. Carry the same settings as config.yaml into all three, and test that every shipped config reads them from the environment. Note in the config comments that the cross-encoder recipes also add breadth-first graph expansion and make one reranker call per candidate: up to 2x the result limit for facts and up to 6x for nodes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The MCP server constructs a cross-encoder, but ordinary node and fact searches use RRF and never call it. This change makes provider and model selection explicit and lets operators enable cross-encoder ranking independently for each search tool.
Behavior
reranker.provider:auto(existing inference),openai,azure_openai,gemini, or localbge; explicit providers look for configuration in both LLM and embedder blocks, trying entries that carry an API key first (LLM before embedder), and fail at startup when unavailable.reranker.model: optional API-backed model override.graphiti.fact_reranker/graphiti.node_reranker:rrfby default, orcross_encoderto invoke the selected client.config-docker-*.yaml) carry the same settings asconfig.yaml, so these environment variables also work in the published images.cross_encoder, the recipes also add breadth-first graph expansion, and an API-backed reranker makes one call per candidate: up to 2x the result limit for facts and up to 6x for nodes. The config comments say so.Verification
Based on upstream main at
3c42764.git diff --checkpasses.Contribution history
This carries forward my July 28 provider-selection implementation from #1698 and my model and recipe implementation from #1859. I kept the original commits and their author dates. It supersedes those two closed PRs.
JohnPark4One identified the RRF bypass and proposed the model and recipe controls in the RFC discussion. Both are his contributions, and I'm acknowledging them here. His node/community summary-ranking work in #1846 is separate from this change.
I submitted this from a clean public contribution fork. It includes no private operational changes.
Closes #1697.