A minimal multi-step research agent framework for DeepSearch AI. Leverages OpenAI chat models, SerpAPI web search, and customizable tools to automatically decompose complex queries, gather evidence, and produce verified answers with references.
- Task decomposition & planning with recursive sub-tasks
- Integrated web search (SerpAPI) & page retrieval (Jina)
- Content summarization & quote extraction
- Automated answer evaluation & refinement
- Configurable LLM models, token limits, and execution policies
- Token usage tracking and usage-based branching
git clone https://github.com/your-org/deepsearch-agents.git
cd deepsearch-agents
pip install . # or: pip install -e .
Configure API keys and model/execution settings before running.
-
Create a
.env
file or export environment variables:OPENAI_API_KEY=your_openai_api_key TRACING_OPENAI_API_KEY=your_tracing_key SERPAPI_API_KEY=your_serpapi_api_key JINA_API_KEY=your_jina_api_key OPENAI_BASE_URL=optional_custom_base_url
-
Edit
settings.yaml
to customize:models
: LLM names, temperatures, max tokens, tool optionsexecution
: max task depth, max turns, token usage limits
Run the CLI entrypoint to issue a query:
python main.py --query "How has the SPX performed in the last 30 days?"
The agent will:
- Reflect on the question and generate sub-questions
- Perform web searches and visits to gather knowledge
- Summarize content and build answers
- Evaluate and refine the final answer with references
.
├── main.py # CLI entrypoint
├── settings.yaml # Default model & execution configs
├── pyproject.toml # Project metadata & dependencies
└── src/
└── deepsearch_agents/
├── conf.py # Configuration loader (env + YAML)
├── context.py # Task & context management
├── planner.py # Task planning & orchestration agent
├── tools/ # Built-in LLM tools (search, visit, ...)
└── llm/ # LLM API integration & response parsing
- Python >= 3.10
- Install dev dependencies (if provided):
pip install -e .[dev]
- Linting & formatting:
pre-commit run --all-files
- Type checking:
mypy src
- Contributions welcome via issues and pull requests.
MIT License. See LICENSE for details.