A minimal multi-agent research workflow using OpenAI and Brave Search.
This project demonstrates a simple agent orchestration pattern in Python:
ResearchPlannerAgentgathers a research plan from the user and saves it via database tools.WebSearchAgentderives search terms from the plan and queries the Brave Search API.SummaryReportAgentsummarizes the collected search results into Markdown.
main.py— application entrypoint and agent definitions.database.py— database initialization and persistence helpers.README.md— this documentation.
- Python 3.11+
openaiPython packagepython-dotenvpydanticrequests
- Create a virtual environment and activate it:
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install dependencies:
pip install openai python-dotenv pydantic requests- Create a
.envfile in the project root with your API keys:
OPENAI_API_KEY=your_openai_api_key
BRAVE_API_KEY=your_brave_search_api_key
Run the application from the repository root:
python main.pyThe program will prompt for a research task. You can type input to build the plan interactively.
Special commands during the prompt loop:
exit— quit the programaccept— finalize the research plan and continue to web search and summarization
After completion, a summary_report.md file is written with the final summary.
WebSearchAgentuses the Brave Search API and expectsBRAVE_API_KEYto be set.- The current flow is simple and can be extended with additional tools, more agents, or improved prompt handling.