This PR resolves issue #3 by implementing a "Planner" node at the beginning of the LangGraph workflow in graph.py.#4
Open
AumPatel1 wants to merge 6 commits intotavily-ai:mainfrom
Open
Conversation
Author
Author
2ef9a73 to
aab3464
Compare
…and redundancies for easier review
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 change refactors the core enrichment logic to move from a simple, brittle search query (
f"{column_name} of {target_value}?") to an intelligent, multi-step "Plan-then-Execute" model. This new architecture can understand natural language questions, create an optimized execution plan, and then use that plan to deliver far more accurate results.New
generate_planNode:** A new node has been added to theEnrichmentPipelineingraph.py. This node uses an LLM to analyze the user's input and generate a structured plan containing anoptimized_search_queryand specificextraction_instructions.Modified
EnrichmentContext: The state object has been updated to carry theplanthroughout the graph's execution.Updated Graph Logic:*
The
StateGraphinbuild_graphnow starts with theplannernode. The existingsearch_tavilyandextract_minimal_answernodes have been modified to use the output from the plan, making them more effective.