Files
2026-06-04 16:06:57 +00:00

55 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Research Brief Agent
## Description
A standalone **LangGraph** based agent that generates a concise research brief for a given topic. The workflow:
1. Generates a 45 point outline for the topic.
2. For each outline point performs a single web search using **Tavily** and records a 58 sentence note.
3. Synthesizes all notes into a coherent brief with headings.
4. 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
```bash
# 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
```bash
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
- `langgraph`
- `langchain-openai`
- `langchain-tavily`
- `tavily-python`
- `python-dotenv`
All are pinned to the latest stable ranges in `requirements.txt`.