366ec8dee74fe3ad4dfa9a2162e90e0b8e6f928d
2
@ 7c8d02b756
2-3-tavily
@ 08e2e01b18
3
@ ddd2bdb8a9
8-deep-agents-from-scratch
@ 865926c001
human-in-the-loop-interrupt-resume
@ 3c81f16ab4
human-in-the-loop-middleware
@ 082d5fb669
llm-interrupt
@ 67ab81df8f
mcp
@ 1fbb6def58
rag
@ f3a37e6521
rag-chromadb
@ d6805973d6
structured-output-union-api
@ 993512bd88
LangGraph Research Brief Agent
This project demonstrates how to build a LangGraph agent that generates a short research brief for a given topic.
The agent:
- Creates an outline of 4‑5 research steps.
- For each step, performs a web search (via Tavily) and writes a concise note.
- Synthesizes all notes into a coherent brief.
Prerequisites
- Python 3.10+
- A Tavily API key (free tier available).
- An OpenAI API key (or any compatible LLM provider).
Setup
# Clone the repository
git clone https://github.com/your-username/langgraph-research-brief.git
cd langgraph-research-brief
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Create a .env file in the project root based on the example:
cp .env.example .env
Edit .env and replace the placeholders with your actual keys:
OPENAI_API_KEY=sk-...
TAVILY_API_KEY=your_tavily_key
Running the Agent
python src/main.py
You should see output similar to:
=== Outline ===
1. Identify the security requirements for MCP integration
2. Review LangChain's authentication mechanisms
3. Evaluate secure communication protocols
4. Test the integration in a sandbox environment
5. Document best practices and compliance checks
=== Notes ===
[Step 1] ... (5‑8 sentence note)
[Step 2] ... (5‑8 sentence note)
...
=== Final Brief ===
...
Project Structure
src/
├── main.py # Entry point
├── graph.py # LangGraph definition
├── nodes.py # Node implementations
├── state.py # TypedDict for state
├── .env.example # Environment variable template
requirements.txt
README.md
Customization
- Topic: Change the
default_topicvariable insrc/main.pyto generate a brief on a different subject. - LLM: Swap
ChatOpenAIfor another provider (e.g., Ollama) by adjusting the imports and initialization insrc/nodes.py. - Search: Replace
TavilySearchResultswith another search tool if desired.
License
MIT License
Description
Languages
Python
38.6%
TypeScript
36.3%
JavaScript
20.4%
CSS
4.7%