Medical Agent with Metta
Overview
This guide demonstrates how to integrate SingularityNET's MeTTa (Meta Type Talk) knowledge graph system with Fetch.ai's uAgents framework to create intelligent, reasoning-capable autonomous agents. This integration enables agents to perform structured knowledge reasoning, pattern matching, and dynamic learning while maintaining compatibility with the ASI:One ecosystem.
What is MeTTa?
MeTTa (Meta Type Talk) is SingularityNET's multi-paradigm language for declarative and functional computations over knowledge (meta)graphs. It provides:
- Structured Knowledge Representation: Organize information in logical, queryable formats
- Symbolic Reasoning: Perform complex logical operations and pattern matching
- Knowledge Graph Operations: Build, query, and manipulate knowledge graphs
- Space-based Architecture: Knowledge stored as atoms in logical spaces
Installation & Setup
Prerequisites
Before you begin, ensure you have:
- Python 3.8+ installed
- pip package manager
- An ASI:One API key (get it from https://asi1.ai/)
Installation Options
You have two ways to install the required dependencies:
Option 1: Install All Dependencies at Once (Recommended)
Create a requirements.txt file with all necessary dependencies:
openai>=1.0.0
hyperon>=0.2.6
uagents>=0.22.5
uagents-core>=0.3.5
python-dotenv>=1.0.0
Install all dependencies with one command:
pip install -r requirements.txt
Option 2: Install Hyperon Separately
If you only want to install Hyperon (MeTTa) first:
pip install hyperon
Verify Hyperon Installation:
python -c "from hyperon import MeTTa; print('Hyperon installed successfully!')"
Windows Installation Guide
If you're using Windows OS and encounter issues installing Hyperon, please refer to this detailed video tutorial:
📺 Hyperon Installation on Windows - Video Guide
Architecture Overview

Architecture pipeline: User / ASI:One Chat → Chat Protocol Handler → ASI:One Intent + Keyword → MedicalRAG → MeTTa Knowledge Graph → Humanized Medical Response → User.
Core Integration Concepts
1. MeTTa Knowledge Graph Structure
MeTTa organizes knowledge as atoms in logical spaces:
from hyperon import MeTTa, E, S, ValueAtom
# Initialize MeTTa space
metta = MeTTa()
# Add knowledge atoms
metta.space().add_atom(E(S("symptom"), S("fever"), S("flu")))
metta.space().add_atom(E(S("treatment"), S("flu"), ValueAtom("rest, fluids, antiviral drugs")))
Key MeTTa Elements:
- E (Expression): Creates logical expressions
- S (Symbol): Represents symbolic atoms
- ValueAtom: Stores actual values (strings, numbers, etc.)
- Space: Container where atoms are stored and queried