Skip to content

swapyface/research-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”¬ Research Agent

A production-grade agentic AI application built with LangGraph and OpenAI GPT-4o that automatically transforms any research topic into a structured blog post draft.

Architecture

User Topic β†’ Planner β†’ Researcher (parallel Tavily searches) β†’ Writer β†’ Reviewer
                                                                      ↑______↓ (revision loop, max 2x)
                                                                            ↓
                                                                  Final Blog Draft

Agents

Agent Role Model
Planner Decomposes topic into 4–6 research questions + outline GPT-4o
Researcher Parallel web searches via Tavily Tavily API
Writer Synthesizes research β†’ Markdown blog post GPT-4o
Reviewer Quality gate with revision loop (max 2 cycles) GPT-4o

Quickstart

git clone https://github.com/swapyface/research-agent.git
cd research-agent
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env   # add OPENAI_API_KEY + TAVILY_API_KEY
python main.py --topic "The impact of LLMs on software engineering"

REST API

uvicorn api:app --reload
curl -X POST http://localhost:8000/research -H "Content-Type: application/json" -d '"'"'{"topic": "Quantum computing in finance"}'"'"'

Project Structure

research-agent/
β”œβ”€β”€ main.py              # CLI entrypoint
β”œβ”€β”€ api.py               # FastAPI async REST server
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ graph.py         # LangGraph StateGraph orchestrator
β”‚   β”œβ”€β”€ agents/          # planner, researcher, writer, reviewer
β”‚   β”œβ”€β”€ prompts/         # All LLM prompts
β”‚   └── utils/           # logger, parsers
└── tests/

License

MIT

About

πŸ”¬ Agentic AI app: LangGraph + GPT-4o pipeline that auto-generates structured blog post drafts from any research topic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages