A micro project to explore LangChain and LangGraph by building a multi-agent system that researches topics and generates article summaries with insights.
Web interface with progress tracking and organized results
- 🔍 Multi-source search using DuckDuckGo (default), Wikipedia, Tavily, or Brave
- 🤖 Three specialized agents: Searcher finds articles, Summarizer condenses content, Insights generates takeaways
- 🔄 Retry logic that broadens queries when results are too few
- 🧠 LLM support for Claude Sonnet 4.5 or Gemini Pro
- ⚡ Typically runs in under 60 seconds
User Input → Searcher → [Check Results] → Summarizer → Insights → Output
↓
[<2 results? Retry with broader query]
The system uses three agents:
- Searcher queries search APIs for relevant articles
- Summarizer uses an LLM to condense articles into key points
- Insights generates actionable takeaways and identifies trends
Stack: LangChain and LangGraph for orchestration, Gradio for the web interface, Claude or Gemini for language processing.
Clone and install dependencies:
git clone <your-repo-url>
cd Lang-Lands
pip install -r requirements.txtCreate a .env file (copy from .env.example):
# Pick one LLM provider
ANTHROPIC_API_KEY=sk-ant-your-key-here
# or
GOOGLE_API_KEY=your-google-key-here
# Optional search upgrades (DuckDuckGo works without keys)
# TAVILY_API_KEY=tvly-xxx # 1000 free searches/month
# BRAVE_API_KEY=xxx # 2000 free searches/monthWeb interface (recommended):
python run_app.pyOpens at http://localhost:7860 with:
- Example topics to get started
- Real-time progress updates
- Tabbed results (summaries, insights, sources)
Command line:
python main.pyEnter a topic when prompted.
Test search only (no LLM required):
python test_run.pyLang-Lands/
├── backend/ # Core logic
│ ├── agents/ # Searcher, Summarizer, Insights
│ ├── graph/ # LangGraph workflow and state
│ ├── utils/ # Search client
│ └── api.py # Clean interface
│
├── frontend/ # Gradio web UI
│ ├── app.py
│ └── components.py
│
├── requirements/ # Split dependencies
│ ├── base.txt # Backend only
│ ├── web.txt # Backend + Gradio
│ └── dev.txt # All + dev tools
│
├── main.py # CLI entry
├── run_app.py # Web entry
└── test_run.py # Search test
$ python main.py
Enter a topic to research: GPT-5 rumors🔍 Searching for: GPT-5 rumors
✓ Found 5 results
📝 Summarizing articles...
✓ Summaries generated
💡 Generating insights...
✓ Insights generated
============================================================
🔍 AI NEWS DIGEST: GPT-5 RUMORS
============================================================
📰 ARTICLE SUMMARIES
• OpenAI hasn't officially announced GPT-5...
• Industry experts speculate Q2 2025 release...
[...]
────────────────────────────────────────────────────────────
💡 KEY INSIGHTS
1. Development Timeline: GPT-5 remains speculative...
2. Capability Expectations: Anticipated improvements...
[...]
────────────────────────────────────────────────────────────
📊 Sources: 5 articles analyzed
LLM providers:
- Claude Sonnet 4.5: Set
ANTHROPIC_API_KEY - Gemini Pro: Set
GOOGLE_API_KEY
Search priority (checks in order):
- Tavily (if
TAVILY_API_KEYset) - Brave (if
BRAVE_API_KEYset) - DuckDuckGo (default, no key needed)
- Wikipedia (fallback)
Add a new agent:
- Create a file in
backend/agents/ - Define a node function accepting and returning
GraphState - Wire it into the workflow in
backend/graph/workflow.py
Modify workflow:
Edit backend/graph/workflow.py to add nodes, change routing, or adjust retry behavior.
Add search providers:
Implement new methods in backend/utils/search_client.py following the existing pattern.
"No LLM API key found"
Create a .env file with ANTHROPIC_API_KEY or GOOGLE_API_KEY.
No search results The bot retries with broader queries automatically (up to 2 times) and falls back to Wikipedia if needed.
Rate limits DuckDuckGo has undocumented rate limits. Switch to Tavily or Brave for higher volume.
MIT License - see LICENSE for details.