a45678340c682a37e1c3cd1ecbeb182cb7e7e0a6
Research Brief Agent
Description
A standalone LangGraph based agent that generates a concise research brief for a given topic. The workflow:
- Generates a 4–5 point outline for the topic.
- For each outline point performs a single web search using Tavily and records a 5–8 sentence note.
- Synthesizes all notes into a coherent brief with headings.
- Outputs the outline, step notes, and final brief to the console.
The agent is fully configurable via environment variables.
Environment Variables
Create a .env file in the project root:
TAVILY_API_KEY=your_tavily_api_key
OPENAI_API_KEY=your_openai_api_key
For local LLMs (e.g., Ollama) replace ChatOpenAI with the appropriate client and provide base_url and api_key.
Installation
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows use .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Usage
python agent.py "Your topic here"
If no topic is provided, the default Artificial Intelligence will be used.
The script prints:
- Outline
- Step notes
- Final brief
Dependencies
langgraphlangchain-openailangchain-tavilytavily-pythonpython-dotenv
All are pinned to the latest stable ranges in requirements.txt.
Description
Languages
Python
100%