This project is an AI Assistant for Literature Searching and Data Analysis in Metabolomics
Metabolomics research involves complex steps that require domain knowledge and specialized skills. These steps can be very challenging, especially for researchers without programming skills. Our system uses specialized AI agents, coordinated by a supervisor agent, to simplify the analysis workflow.
project/
├── frontend/ # Next.js
├── backend/ # Python (FastAPI)
├── metabo_docker # Docker environment build files
└── requirements.txt # Dependencies
Edit backend/.env.sample, fill in the required settings (database connection, API keys, etc.), and rename the file to .env.
pip install -r requirements.txtdocker build -t meta_image:v3 . --no-cachePathway enrichment needs a KEGG gene-set file, which is not distributed with this repository. Generate it locally (a few minutes):
cd ./backend
venv/bin/python -m src.graph_agent.use_tool.download_path_dbSee backend/src/graph_agent/database/README.md for the KEGG version used in the manuscript.
After the build finishes, you can test the agent with test_agent.py
cd ./backend
python -m test_agentcd ./backend
python -m uvicorn main:appcd ./frontend
npm install
npm run devPress ctrl+c to stop the frontend and backend
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API docs: http://localhost:8000/docs
cd backend && venv/bin/python -m pytest tests/ -q # backend tests
cd frontend && npm test && npm run typecheck # frontend tests and type checkAlways run the backend tests with venv/bin/python -m pytest: the global pytest does not have sqlmodel.
npm test does not type-check, so run npm run typecheck separately. A type error makes
npm run build fail even when all tests pass.
- Deployment (including the required nginx settings for SSE and the three Linux installation pitfalls):
docs/deployment.md - Figure-review benchmark:
backend/benchmarks/README.md
The default model is OpenAI gpt-4.1-mini. The model is set in each file that creates an LLM.
There is no single setting for it.
- Install the client:
pip install langchain-ollama. - In each file below, comment out the
ChatOpenAI(...)line and uncomment the# ===== Ollama =====block. Setbase_urlif Ollama does not run onlocalhost:11434. - In
backend/src/graph_agent/supervisor.py, also uncommentfrom .graph.literature_gemma import literature_gemmaand changeliterature_scopingtoliterature_gemmainlit_wrapper.
Files with a prepared Ollama block:
backend/src/graph_agent/supervisor.pybackend/src/graph_agent/tools.pybackend/src/graph_agent/use_tool/literature_add.py
Files without a prepared Ollama block:
backend/src/graph_agent/graph/plot_graph.py(vision model for figure review; replace it with a model that accepts images)backend/src/graph_agent/baseline/single_agent.py(single-agent baseline for the manuscript comparison)
If you do not change a file in these lists, that part of the system continues to use OpenAI.
The benchmark results in the manuscript were produced with the original prompts, which were written in Chinese. Version 0.1.0 translates all prompts and reports into English, so the model can behave differently from the runs reported in the manuscript.
- To reproduce the manuscript runs, use commit
b5f57ff, the last version with the original prompts. - The single-agent baseline (
backend/src/graph_agent/baseline/) keeps its original prompt and skill files in every version. - The benchmark data and evaluation records are archived at https://doi.org/10.5281/zenodo.23055510.
MetaboSquad is released under the MIT License. Pathway data from KEGG and SMPDB are not covered by this license; they are subject to their providers' terms of use.