Skip to main content

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 management
  • TripleStoreService: For knowledge graph operations
  • ObjectStorageService: 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:

  1. Loads Artificial Analysis data
  2. Groups models by AI agent
  3. Generates ontologies in timestamped folders
  4. Deploys current versions to module folders
  5. 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 properties
  • UpdatePersonPipeline: Updates person entities
  • UpdateCommercialOrganizationPipeline: Updates organization entities
  • UpdateSkillPipeline: Updates skill entities
  • UpdateLinkedInPagePipeline: Updates LinkedIn page data
  • UpdateTickerPipeline: Updates stock ticker information
  • UpdateWebsitePipeline: Updates website information
  • UpdateLegalNamePipeline: Updates legal names

Ontologies

The module includes a comprehensive ontology structure organized in a 4-level hierarchy:

  1. Top-level: BFO foundational ontologies
  2. Mid-level: Common Core Ontologies (CCO)
  3. Domain-level: Domain-specific ontologies
  4. 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 framework
  • naas-abi-marketplace>=1.0.0: Marketplace modules and agents
  • thefuzz>=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

License

MIT License

Metadata

Release files for naas-abi 2.85.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for naas-abi 2.85.0
File Size Uploaded
naas_abi-2.85.0.tar.gz 22.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for naas-abi 2.85.0
File Interpreter ABI Platform
naas_abi-2.85.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.8 MB

Release files / naas_abi-2.85.0.tar.gz

Download URL naas_abi-2.85.0.tar.gz
Size 22.0 MB
Tags Source
SHA-256 checksum
How to use checksums
542d75b96786c5ad2187a501ef69e20635a4ef58ce0d9aab46d0ee59a05aa1c0
BLAKE2b-256 checksum
How to use checksums
cfbaf0e39cfca2029c31e4bf66fc6a78641ccecdda6427466b894f2a5a729fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / naas_abi-2.85.0-py3-none-any.whl

Download URL naas_abi-2.85.0-py3-none-any.whl
Size 22.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c983c259865c6f54c49a189c81fa15c5fb786f6fc3f10ccd76646383d4c8aa08
BLAKE2b-256 checksum
How to use checksums
dbe96f4e95bf5b8426d6ab5027ec632b1e6680f72e699c06ec39f9d251e5a338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

2.87.0

2 release files

2.86.0

2 release files

This release

2.85.0 This release

2 release files

2.84.0

2 release files

2.83.1

2 release files

2.74.0

2 release files

2.73.5

2 release files

2.73.4

2 release files

2.73.3

2 release files

2.73.2

2 release files

2.73.1

2 release files

2.72.5

2 release files

2.72.4

2 release files

2.72.3

2 release files

2.72.2

2 release files

2.72.1

2 release files

2.72.0

2 release files

2.71.0

2 release files

2.70.0

2 release files

2.69.0

2 release files

2.68.1

2 release files

2.68.0

2 release files

2.67.2

2 release files

2.67.1

2 release files

2.67.0

2 release files

2.66.1

2 release files

2.66.0

2 release files

2.65.0

2 release files

2.58.0

2 release files

2.57.0

2 release files

2.56.3

2 release files

2.56.2

2 release files

2.56.1

2 release files

2.56.0

2 release files

2.55.3

2 release files

2.55.2

2 release files

2.55.1

2 release files

2.54.3

2 release files

2.54.1

2 release files

2.54.0

2 release files

2.52.5

2 release files

2.52.4

2 release files

2.50.1

2 release files

2.50.0

2 release files

2.49.0

2 release files

2.48.0

2 release files

2.47.0

2 release files

2.46.3

2 release files

2.46.2

2 release files

2.46.1

2 release files

2.46.0

2 release files

2.45.0

2 release files

2.44.0

2 release files

2.43.1

2 release files

2.43.0

2 release files

2.42.3

2 release files

2.38.1

2 release files

2.38.0

2 release files

2.37.0

2 release files

2.36.0

2 release files

2.35.0

2 release files

2.34.1

2 release files

2.34.0

2 release files

2.33.0

2 release files

2.32.0

2 release files

2.31.0

2 release files

2.30.0

2 release files

2.29.0

2 release files

2.28.0

2 release files

2.12.0

2 release files

2.11.1

2 release files

2.11.0

2 release files

2.10.1

2 release files

2.10.0

2 release files

2.9.0

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.55.2

2 release files

1.55.1

2 release files

1.55.0

2 release files

1.54.0

2 release files

1.53.1

2 release files

1.53.0

2 release files

1.52.1

2 release files

1.52.0

2 release files

1.51.1

2 release files

1.51.0

2 release files

1.50.0

2 release files

1.49.1

2 release files

1.49.0

2 release files

1.48.0

2 release files

1.47.1

2 release files

1.47.0

2 release files

1.46.0

2 release files

1.45.1

2 release files

1.45.0

2 release files

1.44.0

2 release files

1.43.2

2 release files

1.43.1

2 release files

1.43.0

2 release files

1.42.1

2 release files

1.42.0

2 release files

1.41.0

2 release files

1.40.0

2 release files

1.39.0

2 release files

1.38.0

2 release files

1.37.3

2 release files

1.30.2

2 release files

1.30.1

2 release files

1.30.0

2 release files

1.29.0

2 release files

1.28.0

2 release files

1.27.0

2 release files

1.26.0

2 release files

1.25.0

2 release files

1.24.1

2 release files

1.24.0

2 release files

1.23.0

2 release files

1.22.5

2 release files

1.22.4

2 release files

1.22.3

2 release files

1.22.2

2 release files

1.22.1

2 release files

1.22.0

2 release files

1.21.1

2 release files

1.21.0

2 release files

1.20.0

2 release files

1.19.4

2 release files

1.19.3

2 release files

1.19.2

2 release files

1.19.1

2 release files

1.18.0

2 release files

1.17.1

2 release files

1.13.0

2 release files

1.12.1

2 release files

1.12.0

2 release files

1.9.7

2 release files

1.9.6

2 release files

1.9.5

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.14

2 release files

1.7.13

2 release files

1.7.12

2 release files

1.7.11

2 release files

1.7.10

2 release files

1.7.9

2 release files

1.7.8

2 release files

1.7.7

2 release files

1.7.6

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.14

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page