Support local query embeddings with visible fallback#35
Draft
plasmaStray wants to merge 3 commits into
Draft
Conversation
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.
What changed
EMBEDDING_API_BASE,EMBEDDING_MODEL, and optionalEMBEDDING_API_KEYWhy
The worker already supports OpenAI-compatible local embedding endpoints, but
scripts/context_enhancer.pyhardcodes OpenRouter for query embeddings. That makes local indexing and query-time semantic retrieval asymmetric and silently disables dense Wiki recall for installations without an OpenRouter key.User impact
Operators can use the same local embedding model for indexing and queries. A cold local backend is awaited before prompt construction. If dense retrieval times out or fails, the assistant is instructed to disclose that Wiki/context recall may be incomplete instead of silently answering as if semantic search succeeded.
Checks
python3 -m py_compile scripts/context_enhancer.py icarus/hooks.py _test_local_embeddings.pypython3 _test_local_embeddings.pypython3 _test_sanitize.pypython3 _test_collapse.pybash -n setup.shgit diff --check