Skip to main content

Agent-Based Infrastructure Core - Runtime and CLI

Project description

ABI-Core ๐Ÿค–

PyPI version Python License Documentation

ABI-Core-AI โ€” The foundation for building Agent-Based Infrastructure (ABI) โ€” a new architectural paradigm where intelligent agents collaborate through semantic context, policy-driven governance, and modular orchestration.

Agent-Based Infrastructure Core โ€” A comprehensive framework for building, deploying, and managing AI agent systems with semantic layers, orchestration, and security policies.


๐Ÿงญ Core Philosophy

ABI-Core is built on three fundamental principles:

  1. Semantic Interoperability โ€” Agents must share meaning, not just data.
  2. Distributed Intelligence โ€” No single model owns the truth; collaboration is the substrate.
  3. Governed Autonomy โ€” Security and compliance must evolve as fast as intelligence itself.

โš ๏ธ Beta Release: This is a beta version. APIs may change and some features are experimental.


๐Ÿš€ Quick Start

Installation

pip install abi-core-ai

Create Your First Project

# Create a new ABI project with semantic layer
abi-core create project my-ai-system --with-semantic-layer

# Navigate to your project
cd my-ai-system

# Provision models (automatically starts services and downloads models)
abi-core provision-models

# Create an agent
abi-core add agent my-agent --description "My first AI agent"

# Create an agent card for semantic discovery
abi-core add agent-card my-agent --description "General purpose AI assistant" --url http://localhost:8000

# Run your project
abi-core run

๐Ÿ“– Need help? Check out our complete documentation with guides, examples, and API reference.


๐Ÿ”ง Model Serving Options

ABI-Core supports two model serving strategies for Ollama:

Centralized (Recommended for Production)

A single shared Ollama service serves all agents:

  • โœ… Lower resource usage โ€” One Ollama instance for all agents
  • โœ… Easier model management โ€” Centralized model updates
  • โœ… Faster agent startup โ€” No need to start individual Ollama instances
  • โœ… Centralized caching โ€” Shared model cache across agents
abi-core create project my-app --model-serving centralized

Distributed (Default)

Each agent has its own Ollama instance:

  • โœ… Complete isolation โ€” Each agent has independent models
  • โœ… Independent versions โ€” Different model versions per agent
  • โœ… Development friendly โ€” Easy to test different configurations
  • โš ๏ธ Higher resource usage โ€” Multiple Ollama instances
abi-core create project my-app --model-serving distributed
# or simply (distributed is default)
abi-core create project my-app

Note: Guardian service always maintains its own Ollama instance for security isolation, regardless of the chosen mode.


๐ŸŽฏ What is ABI-Core?

ABI-Core-AI is a production-ready framework for building Agent-Based Infrastructure systems that combine:

  • ๐Ÿค– AI Agents โ€” LangChain-powered agents with A2A (Agent-to-Agent) communication
  • ๐Ÿง  Semantic Layer โ€” Vector embeddings and distributed knowledge management
  • ๐Ÿ”’ Security โ€” OPA-based policy enforcement and access control
  • ๐ŸŒ Web Interfaces โ€” FastAPI-based REST APIs and real-time dashboards
  • ๐Ÿ“ฆ Containerization โ€” Docker-ready deployments with orchestration

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Agents     โ”‚โ—„โ”€โ”€โ–บโ”‚ Semantic Layer  โ”‚โ—„โ”€โ”€โ–บโ”‚   Guardian      โ”‚
โ”‚                 โ”‚    โ”‚                 โ”‚    โ”‚   Security      โ”‚
โ”‚ โ€ข LangChain     โ”‚    โ”‚ โ€ข Vector DB     โ”‚    โ”‚ โ€ข OPA Policies  โ”‚
โ”‚ โ€ข A2A Protocol  โ”‚    โ”‚ โ€ข Embeddings    โ”‚    โ”‚ โ€ข Access Controlโ”‚
โ”‚ โ€ข Custom Logic  โ”‚    โ”‚ โ€ข Knowledge     โ”‚    โ”‚ โ€ข Monitoring    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  Web Interface  โ”‚
                    โ”‚                 โ”‚
                    โ”‚ โ€ข FastAPI       โ”‚
                    โ”‚ โ€ข Real-time UI  โ”‚
                    โ”‚ โ€ข Monitoring    โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“‹ Features

๐Ÿค– Agent System

  • Multi-Agent Architecture โ€” Create specialized agents for different tasks
  • A2A Communication โ€” Agents can communicate and collaborate
  • LangChain Integration โ€” Leverage the full LangChain ecosystem
  • Custom Tools โ€” Extend agents with domain-specific capabilities

๐Ÿง  Semantic Layer

  • Agent Discovery โ€” MCP-based agent finding and routing
  • Vector Storage โ€” Weaviate-based semantic search (automatically configured)
  • Agent Cards โ€” Structured agent metadata and capabilities
  • Access Validation โ€” OPA-integrated security for semantic access
  • Embedding Mesh โ€” Distributed embedding computation and caching
  • Context Awareness โ€” Agents understand semantic relationships
  • Auto-Configuration โ€” Weaviate vector database included automatically

๐Ÿ”’ Security & Governance

  • Policy Engine โ€” Open Policy Agent (OPA) integration
  • Access Control โ€” Fine-grained permissions and roles
  • Audit Logging โ€” Complete activity tracking
  • Compliance โ€” Built-in security best practices

๐ŸŒ Web & APIs

  • REST APIs โ€” FastAPI-based service endpoints
  • Real-time Updates โ€” WebSocket support for live data
  • Admin Dashboard โ€” Monitor and manage your agent system
  • Custom UIs โ€” Build domain-specific interfaces

๐Ÿ› ๏ธ CLI Commands

Project Management

# Create new projects with optional services and model serving strategy
abi-core create project <name> [--domain <domain>] [--with-semantic-layer] [--with-guardian] [--model-serving centralized|distributed]
abi-core provision-models          # Download and configure LLM models (auto-starts services)
abi-core status                    # Check project status
abi-core run                       # Start all services
abi-core info                      # Show project information

Agent Development

# Create and manage agents
abi-core add agent <name> [--description <desc>] [--model <model>] [--with-web-interface]
abi-core remove agent <name>       # Remove an agent
abi-core info agents               # List all agents

Services Management

# Add services to existing projects
abi-core add service semantic-layer [--name <name>] [--domain <domain>]
abi-core add service guardian [--name <name>] [--domain <domain>]
abi-core add service guardian-native [--name <name>] [--domain <domain>]

# Quick service shortcuts
abi-core add semantic-layer [--domain <domain>]    # Add semantic layer directly
abi-core remove service <name>                     # Remove any service

Agent Cards & Semantic Layer

# Manage agent cards for semantic discovery
abi-core add agent-card <name> [--description <desc>] [--model <model>] [--url <url>] [--tasks <tasks>]
abi-core add policies <name> [--domain <domain>]   # Add security policies

Examples

# Create a finance project with centralized model serving (recommended for production)
abi-core create project fintech-ai --domain finance --with-semantic-layer --with-guardian --model-serving centralized
cd fintech-ai

# Provision models (starts Ollama and downloads qwen2.5:3b + embeddings)
abi-core provision-models

# Add a specialized trading agent (automatically uses centralized Ollama)
abi-core add agent trader --description "AI trading assistant" --model qwen2.5:3b

# Create agent card for semantic discovery
abi-core add agent-card trader --description "Execute trading operations" --url http://localhost:8001 --tasks "trade,analyze,risk-assessment"

# Add semantic layer to existing project (Weaviate included automatically)
abi-core add semantic-layer --domain finance

# Create a development project with distributed model serving (each agent has own Ollama)
abi-core create project dev-project --model-serving distributed
cd dev-project

# Provision models (starts all agents with their Ollama instances + main Ollama for embeddings)
abi-core provision-models

# Remove components when needed
abi-core remove service semantic_layer
abi-core remove agent trader

๐Ÿ“ Project Structure

When you create a new project, you get:

my-project/
โ”œโ”€โ”€ agents/                 # Your AI agents
โ”‚   โ””โ”€โ”€ my-agent/
โ”‚       โ”œโ”€โ”€ agent.py        # Agent implementation
โ”‚       โ”œโ”€โ”€ main.py         # Entry point
โ”‚       โ”œโ”€โ”€ models.py       # Data models
โ”‚       โ””โ”€โ”€ agent_cards/    # Agent cards for semantic discovery
โ”œโ”€โ”€ services/               # Supporting services
โ”‚   โ”œโ”€โ”€ semantic_layer/     # AI agent discovery & routing
โ”‚   โ”‚   โ””โ”€โ”€ layer/
โ”‚   โ”‚       โ”œโ”€โ”€ mcp_server/ # MCP server for agent communication
โ”‚   โ”‚       โ””โ”€โ”€ embedding_mesh/ # Vector embeddings & search
โ”‚   โ””โ”€โ”€ guardian/           # Security & policy enforcement
โ”œโ”€โ”€ agent_cards/            # Global agent cards directory
โ”œโ”€โ”€ config/                 # Configuration files
โ”‚   โ””โ”€โ”€ config.py
โ”œโ”€โ”€ compose.yaml            # Container orchestration
โ”œโ”€โ”€ .abi/                   # ABI project metadata
โ”‚   โ””โ”€โ”€ runtime.yaml
โ””โ”€โ”€ README.md               # Project documentation

๐Ÿ”ง Configuration

ABI-Core uses environment variables and YAML configuration files:

# .abi/runtime.yaml
agents:
  my-agent:
    model: "qwen2.5:3b"
    port: 8000
    
semantic_layer:
  provider: "weaviate"
  host: "localhost:8080"
  
security:
  opa_enabled: true
  policies_path: "./policies"

๐Ÿš€ Deployment

Docker (Recommended)

docker-compose up --build
docker-compose up --scale my-agent=3

Kubernetes

abi-core-ai deploy kubernetes
kubectl apply -f ./k8s/

๐Ÿงช Examples

Simple Agent

from abi_core_ai.agent.agent import AbiAgent
from abi_core_ai.common.utils import abi_logging

class MyAgent(AbiAgent):
    def __init__(self):
        super().__init__(
            agent_name='my-agent',
            description='A helpful AI assistant'
        )
    
    async def stream(self, query: str, context_id: str, task_id: str):
        abi_logging(f"Processing: {query}")
        response = await self.llm.ainvoke(query)
        yield {
            'content': response.content,
            'response_type': 'text',
            'is_task_completed': True
        }

Agent Communication

await self.send_message(
    target_agent="agent-b",
    message="Process this data",
    data={"items": [1, 2, 3]}
)

๐Ÿ“š Documentation

๐Ÿ“– Full Documentation: https://abi-core.readthedocs.io


๐Ÿค Contributing

We welcome contributions! This is a beta release, so your feedback is especially valuable.

Development Setup

git clone https://github.com/Joselo-zn/abi-core-ai
cd abi-core-ai
uv sync --dev

Running Tests

uv run pytest

๐Ÿ“„ License

Apache 2.0 License โ€” see LICENSE for details.


๐Ÿ†˜ Support


๐Ÿ—บ๏ธ Roadmap

Milestone Description Status
v0.2.0 Enhanced agent orchestration ๐Ÿ”œ In progress
v0.3.0 Advanced semantic search ๐Ÿง  Planned
v0.4.0 Multi-cloud deployment ๐Ÿงฉ Planned
v1.0.0 Production-ready stable release ๐Ÿ Target Q3 2026

Built with โค๏ธ by Josรฉ Luis Martรญnez
Creator of ABI (Agent-Based Infrastructure) โ€” redefining how intelligent systems interconnect.

โœจ From Curiosity to Creation: A Personal Note

I first saw a computer in 1995. My dad had received a Windows 3.11 machine as payment for a job. I was fascinated. At the time, I wanted to study robotics โ€” but when I touched that machine, everything changed.

I didn't understand what the Internet was, and I had no idea where to goโ€ฆ but even in that confusion, I felt something big. When I wrote my first Visual C++ program in 1999, I felt like a hacker. When I built my first web page, full of GIFs, I was flying.

Nobody taught me. I just read manuals. And now, years later, that journey continues โ€” not just as a coder, but as the creator of ABI. This is for the kids like me, then and now.

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

abi_core_ai-0.1.0b65.tar.gz (175.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abi_core_ai-0.1.0b65-py3-none-any.whl (201.5 kB view details)

Uploaded Python 3

File details

Details for the file abi_core_ai-0.1.0b65.tar.gz.

File metadata

  • Download URL: abi_core_ai-0.1.0b65.tar.gz
  • Upload date:
  • Size: 175.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for abi_core_ai-0.1.0b65.tar.gz
Algorithm Hash digest
SHA256 21eaffe572bf4451fb188c85f0c9d03d4e063504312509f00586a2fbcc881a6e
MD5 f006772fce023a270f11ac9485d6ca13
BLAKE2b-256 ffc95e362ab2517eb6ec6476685daa8c753483890d6e506af3aacb4c88c64455

See more details on using hashes here.

File details

Details for the file abi_core_ai-0.1.0b65-py3-none-any.whl.

File metadata

File hashes

Hashes for abi_core_ai-0.1.0b65-py3-none-any.whl
Algorithm Hash digest
SHA256 f88347d1bc45f91922caa733c0614e765a6fafde442a88b36ae9ad0e1d4a1260
MD5 56624d4f43e401d44be9989c303ce8c5
BLAKE2b-256 8ff492cd5bb33212deacb5d46e7d1a0db853ccb450b6ebebcbeba32ba54873ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page