MicroFish/backend/app/services
Dominik Seemann fb0ac4b5fe fix(graph): replace passthrough reranker with ollama-backed cross-encoder
Graphiti's default cross-encoder hard-codes the OpenAI gpt-4.1-nano model
and depends on OpenAI-specific logprobs/logit_bias, so the adapter has
been injecting a no-op _PassthroughReranker just to keep search code
paths working. Search results consumed by SearchResult, InsightForge,
Panorama, and Interview were therefore returned in Graphiti's RRF order
with no real reranking signal.

Add an Ollama-backed CrossEncoderClient that scores passages through a
local chat model via the OpenAI-compatible /v1 surface and wire it into
_get_graphiti() behind a RERANKER_PROVIDER switch (default: ollama).
Construction is side-effect-free and the rank() method never raises:
per-passage parse failures degrade to a deterministic low score, and a
whole-call failure falls back to passthrough order with a single WARNING
log so Flask keeps serving when Ollama is unreachable. Setting
RERANKER_PROVIDER=none preserves the legacy passthrough for CI and slim
containers that cannot pull the model.

Closes #39
2026-05-11 10:39:50 +00:00
..
__init__.py docs(i18n): translate chinese docstrings/comments in backend/app/{models,utils} and partial services 2026-05-07 14:44:08 +00:00
graph_builder.py fix(graph): default embeddings to local ollama and gate empty graph builds 2026-05-11 09:43:28 +00:00
graphiti_adapter.py fix(graph): replace passthrough reranker with ollama-backed cross-encoder 2026-05-11 10:39:50 +00:00
oasis_profile_generator.py Merge remote-tracking branch 'origin/main' into feat/25-i18n-oasis-profile-generator-prompts 2026-05-11 11:19:46 +02:00
ollama_reranker.py fix(graph): replace passthrough reranker with ollama-backed cross-encoder 2026-05-11 10:39:50 +00:00
ontology_generator.py Merge branch 'main' into docs/i18n-7-translate-backend-comments 2026-05-09 10:40:10 +00:00
report_agent.py docs(i18n): translate chinese docstrings/comments in backend/services 2026-05-09 10:59:40 +00:00
simulation_config_generator.py docs(i18n): translate chinese docstrings/comments in backend/services 2026-05-09 10:59:40 +00:00
simulation_ipc.py docs(i18n): translate chinese docstrings/comments in backend root, api init, simulation_ipc, simulation_manager, zep_entity_reader 2026-05-07 14:49:20 +00:00
simulation_manager.py docs(i18n): translate chinese docstrings/comments in backend root, api init, simulation_ipc, simulation_manager, zep_entity_reader 2026-05-07 14:49:20 +00:00
simulation_runner.py docs(i18n): translate chinese docstrings/comments in backend/services 2026-05-09 10:59:40 +00:00
text_processor.py docs(i18n): translate chinese docstrings/comments in backend/app/{models,utils} and partial services 2026-05-07 14:44:08 +00:00
zep_entity_reader.py docs(i18n): translate chinese docstrings/comments in backend root, api init, simulation_ipc, simulation_manager, zep_entity_reader 2026-05-07 14:49:20 +00:00
zep_graph_memory_updater.py docs(i18n): translate chinese docstrings/comments in backend/services 2026-05-09 10:59:40 +00:00
zep_tools.py docs(i18n): translate chinese docstrings/comments in backend/services 2026-05-09 10:59:40 +00:00