Multi-agent orchestrator and knowledge graph management system for AI orchestration, providing comprehensive coordination of specialized AI agents and semantic data management capabilities
Project description
naas-abi
Multi-agent orchestrator and knowledge graph management system for AI orchestration, providing comprehensive coordination of specialized AI agents and semantic data management capabilities.
Overview
naas-abi is the central coordination hub for the ABI (Agentic Brain Infrastructure) ecosystem. It provides:
- Multi-Agent Orchestration: Central coordinator managing specialized AI agents (ChatGPT, Claude, Mistral, Gemini, Grok, Llama, Perplexity, Qwen, DeepSeek, Gemma)
- Knowledge Graph Operations: Complete CRUD operations for semantic data management
- Ontology Engineering: BFO-compliant entity extraction and SPARQL generation
- Intelligent Routing: Weighted decision hierarchy with context preservation
- Multilingual Support: Native French/English interactions with cultural awareness
- Production Integration: Event-driven triggers and YAML ontology publishing
Installation
pip install naas-abi
Core Components
ABIModule
The ABIModule is the main module that orchestrates the entire ABI system. It automatically loads marketplace modules (AI agents, applications, domain experts) and provides the core infrastructure.
Configuration:
modules:
- module: naas_abi
enabled: true
config:
datastore_path: "abi"
workspace_id: "{{ secret.WORKSPACE_ID }}"
storage_name: "{{ secret.STORAGE_NAME }}"
Dependencies:
The module automatically loads marketplace modules as soft dependencies (optional):
- AI Agents: ChatGPT, Claude, Mistral, Gemini, Grok, Llama, Perplexity, Qwen, DeepSeek, Gemma
- Applications: GitHub, LinkedIn, Google services, and 50+ other integrations
- Domain Experts: Support, Software Engineering, Data Analysis, and more
Required Services:
Secret: For credential managementTripleStoreService: For knowledge graph operationsObjectStorageService: For file storage
Agents
AbiAgent
The main multi-agent orchestrator that coordinates specialized agents.
Features:
- Intelligent routing based on request type and context
- Context preservation across conversations
- Multilingual support (French/English)
- Weighted decision hierarchy for optimal agent selection
- Strategic advisory capabilities
Usage:
from naas_abi.agents.AbiAgent import create_agent
agent = create_agent()
response = agent.invoke("Route this to the best AI for code generation")
Routing Priorities:
- Context Preservation (0.99): Maintains active conversations
- Identity/Strategic (0.95): Direct Abi responses
- Web Search (0.90): Routes to Perplexity/ChatGPT
- Creative/Multimodal (0.85): Routes to Gemini
- Truth Seeking (0.80): Routes to Grok
- Advanced Reasoning (0.75): Routes to Claude
- Code & Math (0.70): Routes to Mistral
- Knowledge Graph (0.68): Opens KG Explorer
- Internal Knowledge (0.65): Uses ontology agent
- Platform Operations (0.45): Routes to Naas agent
- Issue Management (0.25): Routes to Support agent
EntitytoSPARQLAgent
Extracts entities from natural language and generates SPARQL queries.
Capabilities:
- BFO-compliant entity extraction
- Automatic SPARQL query generation
- Entity relationship mapping
- Ontology-aware query construction
Usage:
from naas_abi.agents.EntitytoSPARQLAgent import create_agent
agent = create_agent()
response = agent.invoke(
"Extract entities from: 'John works at Microsoft as a software engineer'"
)
KnowledgeGraphBuilderAgent
Provides complete CRUD operations for the knowledge graph.
Capabilities:
- Add individuals (entities) to the knowledge graph
- Update properties and relationships
- Remove individuals
- Merge duplicate entities
- Query and explore the graph
Usage:
from naas_abi.agents.KnowledgeGraphBuilderAgent import create_agent
agent = create_agent()
response = agent.invoke(
"Add a new organization called 'NaasAI' to the knowledge graph"
)
OntologyEngineerAgent
Specialized agent for BFO ontology engineering and management.
Capabilities:
- Ontology creation and modification
- BFO-compliant structure validation
- Class and property definition
- Ontology publishing to YAML
Usage:
from naas_abi.agents.OntologyEngineerAgent import create_agent
agent = create_agent()
response = agent.invoke(
"Create a new ontology class for 'SoftwareProject' with properties"
)
Workflows
AgentRecommendationWorkflow
Recommends the best AI agent for a given intent using SPARQL queries.
Features:
- Intent-to-query matching
- SPARQL template parameterization
- Weighted recommendation scoring
- Provider preference support
Usage:
from naas_abi.workflows.AgentRecommendationWorkflow import (
AgentRecommendationWorkflow,
AgentRecommendationConfiguration,
AgentRecommendationParameters
)
workflow = AgentRecommendationWorkflow(
AgentRecommendationConfiguration(queries_file_path="path/to/queries.ttl")
)
result = workflow.run(AgentRecommendationParameters(
intent_description="I need help with code generation",
provider_preference="openai"
))
ArtificialAnalysisWorkflow
Fetches and stores AI model data from the Artificial Analysis API.
Features:
- Fetches model performance data
- Filters for modules with active agents
- Saves timestamped JSON files
- Supports multiple endpoints (models, providers, categories)
Usage:
from naas_abi.workflows.ArtificialAnalysisWorkflow import (
ArtificialAnalysisWorkflow,
ArtificialAnalysisWorkflowConfiguration,
ArtificialAnalysisWorkflowParameters
)
workflow = ArtificialAnalysisWorkflow(
ArtificialAnalysisWorkflowConfiguration(
api_key="your_api_key",
base_url="https://artificialanalysis.ai/api/v2"
)
)
result = workflow.run(ArtificialAnalysisWorkflowParameters(
endpoint="models",
validate_agents_only=True
))
SearchIndividualWorkflow
Searches for individuals (entities) in the knowledge graph.
Features:
- Semantic search across entities
- Fuzzy matching support
- Property-based filtering
- Result ranking
GetSubjectGraphWorkflow
Retrieves the graph structure for a specific subject (entity).
Features:
- Entity relationship exploration
- Configurable depth traversal
- Graph visualization data
- Property and relationship extraction
GetObjectPropertiesFromClassWorkflow
Retrieves object properties for a given ontology class.
Features:
- Class property discovery
- BFO-compliant property extraction
- Relationship type identification
- Ontology hierarchy traversal
Pipelines
AddIndividualPipeline
Adds new individuals (entities) to the knowledge graph.
Features:
- Duplicate detection
- Automatic URI generation
- Property assignment
- Relationship creation
AIAgentOntologyGenerationPipeline
Generates AI agent ontologies from Artificial Analysis data.
Features:
- BFO-structured ontology generation
- Model-to-agent mapping
- Timestamped audit trails
- Automatic deployment to module folders
Execution Steps:
- Loads Artificial Analysis data
- Groups models by AI agent
- Generates ontologies in timestamped folders
- Deploys current versions to module folders
- Creates audit trail and summary
InsertDataSPARQLPipeline
Inserts data into the knowledge graph using SPARQL INSERT queries.
Features:
- SPARQL query execution
- Batch insert operations
- Validation and error handling
- Transaction support
MergeIndividualsPipeline
Merges duplicate individuals in the knowledge graph.
Features:
- Duplicate detection
- Property merging
- Relationship consolidation
- Audit logging
RemoveIndividualPipeline
Removes individuals from the knowledge graph.
Features:
- Safe deletion with validation
- Relationship cleanup
- Audit trail creation
- Backup generation
Update Pipelines
Specialized pipelines for updating specific entity types:
UpdateDataPropertyPipeline: Updates data propertiesUpdatePersonPipeline: Updates person entitiesUpdateCommercialOrganizationPipeline: Updates organization entitiesUpdateSkillPipeline: Updates skill entitiesUpdateLinkedInPagePipeline: Updates LinkedIn page dataUpdateTickerPipeline: Updates stock ticker informationUpdateWebsitePipeline: Updates website informationUpdateLegalNamePipeline: Updates legal names
Ontologies
The module includes a comprehensive ontology structure organized in a 4-level hierarchy:
- Top-level: BFO foundational ontologies
- Mid-level: Common Core Ontologies (CCO)
- Domain-level: Domain-specific ontologies
- Application-level: Use-case specific ontologies
Location: naas_abi/ontologies/
Models
The module supports multiple AI model configurations:
Cloud Mode (Default)
- Model:
gpt-4.1-mini - Provider: OpenAI
- Temperature: 0 (precise orchestration)
- Requires:
OPENAI_API_KEY
Airgap Mode
- Qwen3 (default): Temperature 0.7, 8K context
- Gemma3 (alternative): Temperature 0.2, 8K context
- Requires: Docker Model Runner on
localhost:12434
Configuration:
# Set environment variable
AI_MODE=cloud # or "airgap" or "local"
CLI Tools
The module provides CLI commands for creating new components:
# Create a new module
python -m naas_abi.cli create-module
# Create a new agent
python -m naas_abi.cli create-agent
# Create a new integration
python -m naas_abi.cli create-integration
# Create a new workflow
python -m naas_abi.cli create-workflow
# Create a new pipeline
python -m naas_abi.cli create-pipeline
# Create a new ontology
python -m naas_abi.cli create-ontology
Each command provides an interactive wizard to guide you through the creation process.
Usage Examples
Basic Agent Interaction
from naas_abi_core.engine.Engine import Engine
# Initialize engine
engine = Engine()
engine.load(module_names=["naas_abi"])
# Get AbiAgent
from naas_abi.agents.AbiAgent import create_agent
agent = create_agent()
# Interact with agent
response = agent.invoke("What agents are available?")
print(response)
Knowledge Graph Operations
from naas_abi.agents.KnowledgeGraphBuilderAgent import create_agent
kg_agent = create_agent()
# Add an organization
kg_agent.invoke("Add organization 'NaasAI' with website 'https://naas.ai'")
# Search for entities
from naas_abi.workflows.SearchIndividualWorkflow import (
SearchIndividualWorkflow,
SearchIndividualWorkflowConfiguration,
SearchIndividualWorkflowParameters
)
workflow = SearchIndividualWorkflow(
SearchIndividualWorkflowConfiguration(
triple_store=engine.services.triple_store
)
)
results = workflow.run(SearchIndividualWorkflowParameters(
search_term="NaasAI"
))
Workflow Execution
from naas_abi.workflows.AgentRecommendationWorkflow import (
AgentRecommendationWorkflow,
AgentRecommendationConfiguration,
AgentRecommendationParameters
)
workflow = AgentRecommendationWorkflow(
AgentRecommendationConfiguration(
queries_file_path="path/to/queries.ttl"
)
)
recommendations = workflow.run(AgentRecommendationParameters(
intent_description="I need help with data analysis",
provider_preference="anthropic"
))
Pipeline Execution
from naas_abi.pipelines.AddIndividualPipeline import (
AddIndividualPipeline,
AddIndividualPipelineConfiguration,
AddIndividualPipelineParameters
)
pipeline = AddIndividualPipeline(
AddIndividualPipelineConfiguration(
triple_store=engine.services.triple_store,
search_individual_configuration=SearchIndividualWorkflowConfiguration(
triple_store=engine.services.triple_store
)
)
)
graph = pipeline.run(AddIndividualPipelineParameters(
individual_label="New Company",
individual_type="CommercialOrganization"
))
Configuration
Environment Variables
| Variable | Values | Default | Description |
|---|---|---|---|
AI_MODE |
cloud | airgap | local |
cloud |
Model deployment mode |
OPENAI_API_KEY |
API key | Required (cloud) | For cloud models |
NAAS_API_KEY |
API key | Optional | For production triggers |
ENV |
dev | prod |
dev |
Environment mode |
Module Configuration
modules:
- module: naas_abi
enabled: true
config:
datastore_path: "abi"
workspace_id: "{{ secret.WORKSPACE_ID }}"
storage_name: "{{ secret.STORAGE_NAME }}"
Key Features
๐ Context-Aware Orchestration
Preserves active conversations while enabling intelligent agent transitions.
๐ Multilingual Support
Native French/English code-switching with cultural awareness.
๐ฏ Weighted Decision Routing
Sophisticated hierarchy for optimal agent selection based on request type.
๐ Knowledge Graph Integration
Direct access to SPARQL querying and semantic data exploration.
๐ Deployment Flexibility
Choice between cloud (OpenAI) and airgap (Docker Model Runner) models.
๐ Strategic Advisory
Direct consultation capabilities for business and technical guidance.
๐ก๏ธ Production Ready
Event-driven triggers, comprehensive testing, and error resilience.
Dependencies
naas-abi-core>=1.0.0: Core ABI frameworknaas-abi-marketplace>=1.0.0: Marketplace modules and agentsthefuzz>=0.22.1: Fuzzy string matching
Architecture
Module Structure
naas_abi/
โโโ agents/ # Agent implementations
โ โโโ AbiAgent.py
โ โโโ EntitytoSPARQLAgent.py
โ โโโ KnowledgeGraphBuilderAgent.py
โ โโโ OntologyEngineerAgent.py
โโโ workflows/ # Business logic workflows
โ โโโ AgentRecommendationWorkflow.py
โ โโโ ArtificialAnalysisWorkflow.py
โ โโโ SearchIndividualWorkflow.py
โ โโโ GetSubjectGraphWorkflow.py
โ โโโ GetObjectPropertiesFromClassWorkflow.py
โโโ pipelines/ # Data processing pipelines
โ โโโ AddIndividualPipeline.py
โ โโโ AIAgentOntologyGenerationPipeline.py
โ โโโ InsertDataSPARQLPipeline.py
โ โโโ MergeIndividualsPipeline.py
โ โโโ Update*Pipeline.py
โโโ ontologies/ # Ontology definitions
โโโ models/ # Model configurations
โโโ cli.py # CLI commands
โโโ __init__.py # Module initialization
Testing
# Run all tests
pytest naas_abi/ -v
# Test specific agent
pytest naas_abi/agents/AbiAgent_test.py -v
# Test workflows
pytest naas_abi/workflows/ -v
# Test pipelines
pytest naas_abi/pipelines/ -v
See Also
- ABI Main README - Complete ABI framework documentation
- naas-abi-core - Core engine documentation
- naas-abi-cli - CLI tool documentation
- naas-abi-marketplace - Marketplace modules
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file naas_abi-1.16.1.tar.gz.
File metadata
- Download URL: naas_abi-1.16.1.tar.gz
- Upload date:
- Size: 20.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f23e83af13160cee54261ddbe1bd67323c8ef56ff1ef38ad9703345f9c7ae286
|
|
| MD5 |
85a01ff018c81400a7ecac7c257182f3
|
|
| BLAKE2b-256 |
d9fbc87cad53268f47ddd150296081aa43bec97cec8b6ccdccecb9e4e1990545
|
Provenance
The following attestation bundles were made for naas_abi-1.16.1.tar.gz:
Publisher:
release.yml on jupyter-naas/abi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
naas_abi-1.16.1.tar.gz -
Subject digest:
f23e83af13160cee54261ddbe1bd67323c8ef56ff1ef38ad9703345f9c7ae286 - Sigstore transparency entry: 1223364362
- Sigstore integration time:
-
Permalink:
jupyter-naas/abi@193768ebe2d999cc836df051f96aa90e8dc87f74 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jupyter-naas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@193768ebe2d999cc836df051f96aa90e8dc87f74 -
Trigger Event:
push
-
Statement type:
File details
Details for the file naas_abi-1.16.1-py3-none-any.whl.
File metadata
- Download URL: naas_abi-1.16.1-py3-none-any.whl
- Upload date:
- Size: 21.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c53fbeaedb2bb12c5623f3c87a6e85756258492f135ca1f53429d5bf621381b
|
|
| MD5 |
c98acfffb24af6c1bafccfcd78aae964
|
|
| BLAKE2b-256 |
7c32d23f9ea65fe15d8f351c154f2efb826baf73df2a5d4badd301588f6b94ba
|
Provenance
The following attestation bundles were made for naas_abi-1.16.1-py3-none-any.whl:
Publisher:
release.yml on jupyter-naas/abi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
naas_abi-1.16.1-py3-none-any.whl -
Subject digest:
9c53fbeaedb2bb12c5623f3c87a6e85756258492f135ca1f53429d5bf621381b - Sigstore transparency entry: 1223364396
- Sigstore integration time:
-
Permalink:
jupyter-naas/abi@193768ebe2d999cc836df051f96aa90e8dc87f74 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jupyter-naas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@193768ebe2d999cc836df051f96aa90e8dc87f74 -
Trigger Event:
push
-
Statement type: