A comprehensive AI-powered chemistry research system that combines database querying, literature analysis, and automated report generation. This project demonstrates how to build a multi-agent system for scientific research using Google's Agent Development Kit (ADK).
- Multi-Agent Architecture: Hierarchical agent system with specialized sub-agents
- Database Integration: SQLite-based local database with CSV data loading
- Literature Analysis: Automated paper reading and content extraction
- Report Generation: AI-powered scientific report creation
- RESTful API: Flask-based API for database operations
- Chemistry Research Agent: Main orchestrator agent that coordinates research tasks
- Database Agent: Handles structured data queries and fact retrieval
- Deep Research Agent: Performs literature reviews and generates reports
- Paper Agent: Processes individual research papers
- Report Agent: Synthesizes findings into comprehensive reports
deep_research_tutorial/
├── agent/ # Multi-agent system
│ ├── agent.py # Main chemistry research agent
│ ├── callbacks.py # Agent callback functions
│ ├── llm_config.py # LLM configuration
│ ├── database_agent/ # Database query agent
│ ├── deep_research_agent/ # Literature research agent
│ │ ├── agent.py # Deep research orchestrator
│ │ ├── paper_agent/ # Individual paper processor
│ │ └── report_agent/ # Report generation agent
│ └── tools/ # Agent tools and utilities
├── database_server/ # Database and API services
│ ├── service.py # Flask API and database service
│ ├── polymer.csv # Polymer data
│ ├── paper_metadata.csv # Paper metadata
│ └── paper_text.csv # Paper content data
├── my_data.db # SQLite database file
├── pyproject.toml # Project dependencies
└── README.md # This file
- Python 3.12 or higher
- UV package manager (recommended)
-
Clone the repository
git clone <repository-url> cd deep_research_tutorial
-
Install dependencies
uv sync
-
Set up environment variables
# Create a .env file with your API keys echo "OPENAI_API_KEY=your_openai_key_here" > .env echo "GOOGLE_API_KEY=your_google_key_here" > .env echo "DEEPSEEK_API_KEY=your_deepseek_key_here" > .env
python database_server/service.pyThis will:
- Load CSV data into SQLite database
- Start Flask API server on
http://localhost:5000 - Make database accessible via REST API
uv run adk webThe main chemistry research agent:
- Analyzes user intent
- Creates a step-by-step research plan
- Proposes actions one at a time
The database agent:
- Searches structured data for facts
- Retrieves relevant paper metadata
- Returns formatted results
The deep research agent:
- Processes relevant papers in parallel
- Extracts key information
- Synthesizes findings
The report agent:
- Compiles all findings
- Generates comprehensive reports
- Formats output for user consumption
"What is the melting point of paracetamol?"
"Find solvents for recrystallizing benzoic acid"
"What are the properties of polyimide polymers?"
"Recent advancements in asymmetric catalysis for ibuprofen synthesis"
"Biocompatibility studies of PLA polymers"
"Novel methods for polymer characterization"
Edit agent/llm_config.py to customize:
- Model selection (GPT-4, Claude, etc.)
- API endpoints
- Temperature and other parameters
Modify database_server/service.py to:
- Change database file path
- Add new data sources
- Customize API endpoints
Key dependencies include:
google-adk>=1.5.0- Google Agent Development Kitlitellm>=1.73.1- LLM abstraction layeropenai>=1.91.0- OpenAI API clientpandas>=2.3.0- Data manipulationflask>=3.1.1- Web frameworkpydantic>=2.11.7- Data validationrequests>=2.32.4- HTTP client
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Agent Development Kit (ADK) team
- OpenAI for LLM APIs
- The chemistry research community at DP Technology
For questions and support:
- Open an issue on GitHub
- Check the documentation
- Review the example usage
Note: This is a tutorial project demonstrating AI-powered research workflows. For production use, ensure proper security, validation, and error handling.