search: precompute intent once, reuse across all semantic_search calls#76
Open
donsummerwind wants to merge 1 commit intosopaco:mainfrom
Open
search: precompute intent once, reuse across all semantic_search calls#76donsummerwind wants to merge 1 commit intosopaco:mainfrom
donsummerwind wants to merge 1 commit intosopaco:mainfrom
Conversation
- SearchOptions gains precomputed_intent: Option<Arc<EnhancedQueryIntent>> - search handler calls analyze_intent() once before layered_semantic_search - layered + 4 semantic_search calls all reuse the same intent (5 LLM calls → 1) - ~3-5x search speedup depending on model warm/cold state fixes: 5 serial LLM calls per search (intent analysis bottleneck)
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
Precompute LLM intent analysis once per search, then reuse across all
semantic_searchcalls. Reduces LLM calls from 5 to 1 per search.Changes
SearchOptionsgainsprecomputed_intent: Option<Arc<EnhancedQueryIntent>>search_handlercallsanalyze_intent()once before layered_semantic_searchPerformance
Files changed
cortex-mem-core/src/search/vector_engine.rscortex-mem-core/src/types.rscortex-mem-core/src/vector_store/qdrant.rscortex-mem-service/src/handlers/filesystem.rscortex-mem-service/src/handlers/search.rscortex-mem-service/src/main.rs