ReActFlow-Agent is a production-grade, autonomous multi-agent system that researches, plans, and generates comprehensive, personalized travel itineraries β powered by LangGraph, Groq LLMs, RAG memory, and real-time web intelligence.
π Quick Start Β· ποΈ Architecture Β· π€ Agents Β· π οΈ Tools Β· π‘ Features Β· βοΈ Configuration
|
|
|
|
User Query
β
βΌ
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β π§ Planner |βββββΆβ πΎ Memory ββββββΆβ π€ Profile β
β Agent β β Agent (RAG) β β Agent β
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β
βββββββββββββββββββ€
β Parallel Send()
βββββββββββΌβββββββββββββββββββββββββββ
β π Research Worker Γ 3 tasks |
β [Tavily + SerpAPI + Maps] β
βββββββββββββββββββββββ¬βββββββββββββββ
β Merge + Reduce
βΌ
βββββββββββββββββββββββββ
β π§ Supervisor Agent β
β approve / retry loop β
βββββββββββββ¬ββββββββββββ
β approve
βββββββββββββββββΌββββββββββββββββ
β π
Itinerary Agent β
βββββββββββββββββ¬ββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
β π Summarizer Agent β
β (saves to RAG memory) β
βββββββββββββββββ¬ββββββββββββββββ
β
βΌ
β
Final Travel Report
| Pattern | Implementation |
|---|---|
| Map-Reduce | Send() dispatches N parallel research tasks; operator.add reducer merges results |
| State Typing | Annotated[list, operator.add] on research_results, sources, agent_logs |
| Supervisor Loop | Conditional routing with retry cap (max 2), decision moved into node not router |
| RAG Pipeline | ChromaDB + HuggingFace embeddings for cross-session travel memory retrieval |
| Profile Extraction | Groq structured output β Pydantic UserProfile β persisted JSON |
Here is a walk-through of the ReActFlow-Agent dashboard and execution workflow:
Set your travel style, preferred transportation, food preferences, and climate style. The profile is automatically persisted locally as a JSON model and retrieved to guide all subsequent agent routing and recommendations.
See the parallel agent execution live. As the planner node breaks down your query into independent tasks, parallel Groq research workers spin up, call Tavily/SerpAPI, and output live execution logs.
Before planning, the system performs a semantic similarity search in ChromaDB. Relevant historical preferences and past itineraries are injected as custom context to provide context-aware planning across sessions.
The agent designs structured daily modules for Morning, Afternoon, Evening, Food, Transport, and Budget details.
The end product is a beautifully synthesized markdown document containing local weather advice, attraction logs, budgeting projections, packing lists, itineraries, and citations.
Model: llama-3.1-8b-instant
Decomposes the user's raw travel query into 3 focused research sub-tasks (capped to prevent TPM saturation). Uses structured output to return a TravelPlan with a tasks: list[str] field.
Input: { "user_query": "Plan a 7-day budget trip to Japan..." }
Output: TravelPlan(tasks=["Japan budget accommodation", "Tokyo transport", "Food guide"])Store: ChromaDB + sentence-transformers/all-MiniLM-L6-v2
Performs semantic similarity search against all previous travel sessions and returns relevant context to personalize the current run.
# Retrieval
memories = retrieve_memory(user_query) # β List[Document]
# Storage (after summarizer)
save_memory(f"User Query:\n{query}\n\nFinal Response:\n{response}")Model: llama-3.1-8b-instant
Extracts traveler preferences from the query and merges them into the persistent profile. Fields are deduplicated on lists and overwritten on scalars.
class UserProfile(BaseModel):
budget_style: str # "budget" | "mid-range" | "luxury"
preferred_transport: str # "train" | "flight" | "car"
climate_preference: str # "cold" | "hot" | "temperate"
travel_style: str # "adventure" | "backpacker" | "luxury"
favorite_destinations: list[str] # ["Japan", "Italy"]
food_preferences: list[str] # ["local", "sushi"]Model: llama-3.3-70b-versatile
Each worker independently searches Tavily + SerpAPI and synthesizes results into a ResearchResult with findings: list[str] and sources: list[Source]. Results are automatically merged via the operator.add LangGraph reducer β no manual aggregation needed.
Why 70B here? Smaller models (8B) fail to reliably call nested structured output schemas (
ResearchResultcontainingList[Source]). The 70B model is essential for reliable tool-call generation.
Model: llama-3.1-8b-instant
Quality-gates the research. Outputs approve or retry. Retry routes back to the Profile node for context re-enrichment. Hard cap at 2 retries prevents infinite loops.
class SupervisorDecision(BaseModel):
decision: str # "approve" | "retry"
feedback: str # Explanation for retry, or approval noteModel: llama-3.3-70b-versatile
Generates a detailed day-by-day markdown itinerary from the merged research findings. Each day includes Morning / Afternoon / Evening / Food / Transport / Budget sections.
Model: llama-3.3-70b-versatile
Synthesizes research findings, memories, itinerary, and sources into the final comprehensive travel report with all sections: Overview, Weather, Attractions, Food, Budget, Transport, Tips, Itinerary, and Sources. Saves the response to RAG memory for future sessions.
| Tool | Description | API |
|---|---|---|
tavily_search |
AI-optimized semantic web search, returns clean structured results | Tavily |
serp_search |
Google organic search results + snippets via SerpAPI | SerpAPI |
maps_tool |
Geolocation, distance, and place data | Geopy |
weather_tool |
Weather context for destination planning | β |
budget_tool |
Budget estimation context | β |
clothing_tool |
Climate-based clothing recommendations | β |
ReActFlow-Agent/
β
βββ app.py # Gradio dashboard + streaming runner
β
βββ graph/
β βββ workflow.py # LangGraph StateGraph definition
β
βββ agents/
β βββ planner_agent.py # Task decomposition
β βββ profile_agent.py # Preference extraction
β βββ research_agent.py # Web research + synthesis
β βββ supervisor_agent.py # Quality control + routing
β βββ itinerary_agent.py # Day-by-day schedule generation
β βββ summarizer_agent.py # Final report synthesis
β βββ react_agent.py # ReAct reasoning agent (base)
β
βββ memory/
β βββ rag_memory.py # Save + retrieve from ChromaDB
β βββ vector_store.py # ChromaDB client initialization
β βββ profile_memory.py # JSON profile load/save
β βββ user_profile.json # Persisted traveler profile
β
βββ schemas/
β βββ research_schema.py # ResearchResult + Source models
β βββ user_profile.py # UserProfile Pydantic model
β βββ state.py # Shared state types
β
βββ tools/
β βββ tavily_search.py # Tavily web search tool
β βββ serp_search.py # SerpAPI Google search tool
β βββ maps_tool.py # Geolocation tool
β βββ browser_tool.py # Web scraping (deprecated)
β βββ weather_tool.py # Weather context tool
β βββ budget_tool.py # Budget estimation tool
β βββ clothing_tool.py # Clothing recommendations
β
βββ config/
β βββ langsmith_config.py # LangSmith tracing setup
β
βββ prompts/
β βββ prompts.py # Shared prompt templates
β
βββ images/ # README assets
βββ .env # API keys (see below)
βββ .env.example # Template
βββ requirements.txt
git clone https://github.com/Dakshin10/ReActFlow-Agent.git
cd ReActFlow-Agentpython -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txtCopy the example environment file and fill in your keys:
cp .env.example .env# .env
GROQ_API_KEY=gsk_... # https://console.groq.com
TAVILY_API_KEY=tvly-... # https://tavily.com
SERPAPI_API_KEY=... # https://serpapi.com
LANGCHAIN_API_KEY=lsv2_... # https://smith.langchain.com (optional tracing)
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=ReActFlow-Agentpython app.pyOpen http://127.0.0.1:7860 in your browser.
| Agent | Model | Reason |
|---|---|---|
| Planner | llama-3.1-8b-instant |
Simple list output, fast |
| Profile | llama-3.1-8b-instant |
Flat Pydantic schema, fast |
| Research | llama-3.3-70b-versatile |
Nested structured output reliability |
| Supervisor | llama-3.1-8b-instant |
Binary decision, fast |
| Itinerary | llama-3.3-70b-versatile |
Long-form quality markdown |
| Summarizer | llama-3.3-70b-versatile |
Comprehensive report quality |
All agents have
max_retries=6for automatic Groq rate-limit backoff.
The planner is capped at 3 parallel research tasks by default to stay within Groq's free-tier TPM limits. Upgrade your Groq plan to increase this:
# graph/workflow.py β planner_node
tasks = result.tasks[:3] # β increase for paid tiersclass GraphState(TypedDict):
user_query: str
tasks: list
# operator.add reducer β safe parallel merge
research_results: Annotated[list, operator.add]
sources: Annotated[list, operator.add]
agent_logs: Annotated[list, operator.add]
retrieved_memories: list
supervisor_feedback:str
retry_count: int
decision: str
itinerary: str
user_profile: dict
final_response: strCritical:
Annotated[list, operator.add]is required on any key that receives writes from parallelSend()branches. Without it, LangGraph will deadlock or silently overwrite results.
| Issue | Root Cause | Fix |
|---|---|---|
| Graph freezes after research | Missing operator.add reducer on research_results |
Added Annotated[list, operator.add] to all parallel keys |
UserProfile 400 BadRequest |
Groq returning list[str] fields as plain str |
Added Field(description="MUST be an array...") to schema |
| Router state mutation | state["retry_count"] += 1 inside a read-only router |
Moved to supervisor_node return dict |
| 413 Request Too Large | Browser scraping 15,000+ chars into LLM context | Eliminated scraping; condensed to title+url+snippet only |
| 429 TPM Rate Limit | 17 parallel workers hitting Groq simultaneously | Capped planner at 3 tasks |
| Model decommissioned | llama3-8b-8192 removed from Groq |
Migrated to llama-3.1-8b-instant |
| Nested schema tool-call failure | 8B model can't call ResearchResult + List[Source] reliably |
Research agent uses 70B model exclusively |
Plan a 10-day budget winter trip to Japan for a solo college student who loves food and hiking
7-day luxury honeymoon in Maldives with underwater dining and spa experiences
3-day weekend budget city break in Amsterdam for two people who love museums and cycling
2-week backpacking route through Southeast Asia (Thailand, Vietnam, Cambodia) under $1500
gradio
langchain
langgraph
langchain-core
langchain-community
langchain-groq
langchain-tavily
langsmith
tavily-python
python-dotenv
google-search-results
beautifulsoup4
requests
chromadb
langchain-chroma
sentence-transformers
langchain-huggingface
geopy
pydantic
This project is licensed under the MIT License β see the LICENSE file for details.
Built with β€οΈ using LangGraph Β· Groq Β· Gradio Β· ChromaDB
If you find this project useful, please consider giving it a β





