# Future Roadmap
### 1. Hybrid Search (Keyword + Semantic)
**Mitigation for Keyword Mismatch:** Integrate a lightweight vector database (e.g., Chroma or FAISS) to index the codebase. This allows the system to find relevant code chunks based on semantic meaning (embedding similarity) rather than relying solely on exact regex matches via `grep`.
### 2. AST-Based Navigation (Symbol Graph)
**Mitigation for Polyglot Confusion:** Instead of treating code as text, integrate `tree-sitter`.
* Allow the LLM to query the Abstract Syntax Tree (AST): "List all classes inheriting from `BaseHandler`" or "Find the definition of function `save`".
* This provides structured navigation that is language-aware and immune to grep noise.
### 3. Smart "Call Graph" Traversal
**Mitigation for Hallucinated Paths:** Implement a "Go to Definition" / "Find References" tool. Instead of guessing where a function is defined, the agent should be able to grep a usage of the function and follow the import path to the source file programmatically.
### 4. Dynamic Context Window Management
**Mitigation for Truncation:**
* Implement a "scroll/expand" feature for `read_file` to allow the LLM to request surrounding lines if a snippet looks promising.
* Implement a two-pass grep: First pass counts matches per file, second pass targets specific files with high density of relevant terms.
### 5. Reflexive Error Recovery
**Mitigation for Loops:** Update the `NextActionDecision` logic. If an action yields 0 results or looks identical to a previous action, force a "Reflexion" step where the LLM must explicitly generate a *different* strategy (e.g., switching from "Specific File" to "Broad Directory Listing") before proceeding.