|
|
||
|---|---|---|
| .. | ||
| README.md | ||
| flow.py | ||
| main.py | ||
| nodes.py | ||
| requirements.txt | ||
| utils.py | ||
README.md
Research Agent
This project demonstrates a simple yet powerful LLM-powered research agent. This implementation is based directly on the tutorial: LLM Agents are simply Graph — Tutorial For Dummies.
Features
- Performs web searches to gather information
- Makes decisions about when to search vs. when to answer
- Generates comprehensive answers based on research findings
Getting Started
- Install the packages you need with this simple command:
pip install -r requirements.txt
- Let's get your OpenAI API key ready:
export OPENAI_API_KEY="your-api-key-here"
- Let's do a quick check to make sure your API key is working properly:
python utils.py
This will test both the LLM call and web search features. If you see responses, you're good to go!
- Try out the agent with the default question (about Nobel Prize winners):
python main.py
- Got a burning question? Ask anything you want by using the
--prefix:
python main.py --"What is quantum computing?"
How It Works?
The magic happens through a simple but powerful graph structure with three main parts:
graph TD
A[DecideAction] -->|"search"| B[SearchWeb]
A -->|"answer"| C[AnswerQuestion]
B -->|"decide"| A
Here's what each part does:
- DecideAction: The brain that figures out whether to search or answer
- SearchWeb: The researcher that goes out and finds information
- AnswerQuestion: The writer that crafts the final answer
Here's what's in each file: