feat(app,backend): RAG pipeline improvements and token estimation - #31
Merged
Merged
Conversation
Frontend: - Replace API token counts with client-side estimation (~4 chars/token) - Add ~ prefix to context indicator for approximate values - Optimize ModelSelector to prevent unnecessary re-fetches Backend: - Add dynamic threshold-based memory filtering - Add match type tracking (vector/keyword/hybrid) and RRF scores - Add model-specific embedding context windows with chunking - Add comprehensive logging throughout search pipeline - Block all-minilm embedding model (context too small) - Remove conversation history limit for fuller context
comppaz
force-pushed
the
feat/rag-improvements-and-token-estimation
branch
from
December 15, 2025 20:11
a6b4bc8 to
180351a
Compare
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.
Summary
This PR introduces improvements to the RAG pipeline and replaces API-provided token counts with client-side estimation for a more stable UI experience.
Frontend Changes
~prefix, more stable without flickeringBackend Changes
all-minilmmodel, removed conversation history limitFiles Changed
app/src/components/ContextUsageIndicator.tsxapp/src/components/ModelSelector.tsxapp/src/contexts/ConversationContext.tsxapp/src/pages/ChatPage.tsxbackend/app/db/search.pybackend/app/main.pybackend/app/native_messaging.pybackend/app/routes/chat.pybackend/app/routes/settings.pybackend/app/services/ai.pybackend/app/services/embeddings.pybackend/app/services/query_processing.pyTest Plan
~prefix