Installation Guide π¶
This guide will walk you through the process of installing π§ͺ MetaboT π΅ and its dependencies.
Prerequisites π¶
Before installing π§ͺ MetaboT π΅, ensure you have the following installed:
- pip (Python package installer) β Install pip
- conda β Install Miniconda
- Git β Install Git
- LLM API Key β Get an API key for your chosen language model (OpenAI, DeepSeek, or Claude)
- WSL (for Windows users) β Install WSL
Clone the Repository and switch to the dev
branch:π₯¶
Create and Activate the Conda Environment βοΈ¶
For macOS:
For Linux:
sudo apt-get update
sudo apt-get install -y python3-dev build-essential
conda env create -f environment.yml
conda activate metabot
For Windows (using WSL):
- Install WSL if you haven't already:
- Open WSL and install the required packages:
- Install Miniconda in WSL:
- Create and activate the conda environment:
Install Dependencies π¦¶
Environment Variables π¶
Create a .env
file in the root directory with the following variables:
# Optional: API Keys for external services
OPENAI_API_KEY=your_openai_api_key # If using OpenAI service
DEEPSEEK_API_KEY=your_deepseek_api_key # If using DeepSeek API service
OVHCLOUD_API_KEY=your_ovhcloud_api_key # If using the OVHcloud services
Language Model Configuration π€¶
By default, all agents in MetaboT use OpenAI models, but you can configure different models for each agent. The current implementation supports: - OpenAI - DeepSeek - Claude (Anthropic) - Llama (via OVHcloud)
Adding New Models¶
To add a new model using LiteLLM:
-
Add a new section in
app/config/params.ini
: -
Add your provider and API key mapping in
app/core/main.py
: -
Modify the provider detection in
create_litellm_model
function:
The function automatically handles:
- Provider detection based on model ID prefix
- API key retrieval from environment variables
- Basic parameters (temperature, max_retries)
- Optional base URL configuration
Configuring Models for Different Agents¶
To use different models for different agents, modify app/config/langgraph.json
. In the agents section, specify llm_choice
with the name of your model section from params.ini:
{
"agents": [
{
"name": "Entry_Agent",
"path": "app.core.agents.entry.agent",
"llm_choice": "llm_litellm_your_model_name"
},
{
"name": "Validator",
"path": "app.core.agents.validator.agent",
"llm_choice": "llm_litellm_different_model"
}
]
}
SPARQL Endpoint Configuration π¶
Configure your SPARQL endpoint exclusively by setting the KG_ENDPOINT_URL
variable in your .env
file.
Verify Installation β ¶
To verify the installation, execute the following command:
This command initiates the agent workflow by constructing the RDF graph using the endpoint specified via the KG_ENDPOINT_URL variable in your .env file, instantiating the requisite language models, and executing one of the predefined standard queries. Successful execution confirms the proper configuration and integration of the system's core functionalities, including graph management and SPARQL query generation.
Common Issues π¶
Issue: SPARQL Endpoint Connection¶
If SPARQL queries fail:
-
Check if the SPARQL endpoint is accessible.
-
Verify that the
KG_ENDPOINT_URL
variable in your.env
file is correctly set. -
Ensure proper network access/firewall settings.
Mass Spectrometry Data π¬¶
By default, π§ͺ MetaboT π΅ connects to the public ENPKG endpoint which hosts an open, annotated mass spectrometry dataset derived from a chemodiverse collection of 1,600 plant extracts. This default dataset enables you to explore all features of π§ͺ MetaboT π΅ without the need for custom data conversion immediately. To use π§ͺ MetaboT π΅ on your mass spectrometry data, the processed and annotated results must first be converted into a knowledge graph format using the ENPKG tool. For more details on converting your own data, please refer to the Experimental Natural Products Knowledge Graph library and the associated publication.
Set your SPARQL endpoint by configuring the KG_ENDPOINT_URL
variable in your .env
file. If you are deploying a local endpoint that requires authentication, add the following variables to your .env
file:
Additionally, to ensure the SPARQL queries generated accurately reflect the schema of your knowledge graph, you must provide detailed information about your knowledge graphβs structure and update the prompt settings in:
app/core/agents/validator/prompt.py
- The SPARQL generation chain in
app/core/agents/sparql/tool_sparql.py
Support π οΈ¶
If you encounter any issues during installation:
- Check our GitHub Issues for similar problems.
- Create a new issue with detailed information about your setup and the error.
Next Steps
- Follow the Quick Start Guide to begin using π§ͺ MetaboT π΅.
- Review the Configuration Guide for detailed setup options.
- Check out Example Usage for practical applications.