Skip to content

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
AumPatel1:main
Open

This PR resolves issue #3 by implementing a "Planner" node at the beginning of the LangGraph workflow in graph.py.#4
AumPatel1 wants to merge 6 commits intotavily-ai:mainfrom
AumPatel1:main

Conversation

@AumPatel1
Copy link

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_plan Node:** A new node has been added to the EnrichmentPipeline in graph.py. This node uses an LLM to analyze the user's input and generate a structured plan containing an optimized_search_query and specific extraction_instructions.
Modified EnrichmentContext: The state object has been updated to carry the plan throughout the graph's execution.
Updated Graph Logic:*

The StateGraph in build_graph now starts with the planner node. The existing search_tavily and extract_minimal_answer nodes have been modified to use the output from the plan, making them more effective.

@AumPatel1
Copy link
Author

Screenshot 2025-07-08 at 12 47 29 AM

before

@AumPatel1
Copy link
Author

Screenshot 2025-07-08 at 12 49 19 AM Screenshot 2025-07-08 at 12 48 17 AM

after

@AumPatel1 AumPatel1 force-pushed the main branch 2 times, most recently from 2ef9a73 to aab3464 Compare July 9, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant