Conversation
…rch flow - Migrate all LLM nodes (query generation, reflection, final answer) from Gemini to Groq using llama-3.3-70b-versatile - Keep Gemini exclusively for Google Search grounding to preserve citation metadata - Add graceful handling for Google Search API quota exhaustion (429 / RESOURCE_EXHAUSTED) - Return safe fallback state instead of crashing the graph - Guard against missing or partial API responses - Handle empty candidates and absent grounding metadata - Fall back to plain-text extraction when citations cannot be generated - Improve robustness and documentation - Defensive access to graph state keys - Fix docstring inconsistencies and remove redundant comments
The search component operates on a user-provided directory and retrieves relevant documentation snippets directly from markdown files. Architecture decision: I chose an extended-context, file-based search approach instead of a broad snippet search or vector database. Technical documentation often contains long code examples that are easily truncated by short RAG-style snippets. To preserve full examples while respecting Groq token limits, the search retrieves a small number of highly relevant results (top_k=2) with a larger context window (~100 lines). Relevance is determined using a deterministic keyword and phrase scoring mechanism without external dependencies. This design keeps the agent lightweight, reproducible, and suitable for offline evaluation on local documentation archives.
pesua
reviewed
Jan 22, 2026
| text_lower = text.lower() | ||
|
|
||
| # Score file path matches (boost) | ||
| path_score = sum(path_lower.count(t) * 3 for t in terms) + sum(path_lower.count(p) * 5 for p in phrases) |
| # Find best match position (prefer phrase matches, then term matches) | ||
| best_idx = len(text) | ||
| best_token = None | ||
| for p in phrases: |
Collaborator
There was a problem hiding this comment.
Дуже заморочений алгоритм пошуку, ти бачив на тестах щоб він працював краще за якийсь примітивний фултекст?
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.
This PR contains two commits: