Skip to main content

Agent-Based Infrastructure Core - Runtime and CLI

Project description

ABI-Core ๐Ÿค–

PyPI version Python License Documentation

ABI-Core is the foundation for building Agent-Based Infrastructure โ€” a framework where intelligent agents collaborate through semantic context, policy-driven governance, and modular orchestration.

ABI Swarm is the runtime: a self-building multi-agent system that plans, orchestrates, and creates agents on demand โ€” governed by policy.

Beta Release โ€” APIs may change. Feedback welcome.


What Makes ABI Different

Most agent frameworks assume your agents and tools already exist. ABI doesn't.

  • The Planner decomposes complex requests into tasks and finds (or creates) the right agents
  • The Orchestrator coordinates execution across multiple agents with A2A protocol
  • The Builder creates ephemeral agents on demand โ€” Docker containers that live, execute, and die
  • The Guardian enforces security policies via OPA before any agent communicates
  • The Semantic Layer connects everything through vector search and MCP tools

If an agent doesn't exist for a task, ABI builds one. If a tool doesn't exist, ABI creates it. All governed by policy.


Quick Start

pip install abi-core-ai

# Create a project
abi-core create project my-system --with-semantic-layer --with-guardian

# Add the swarm (planner + orchestrator + builder + semantic layer + guardian)
abi-core add abi-swarm

# Run
docker compose up -d

Architecture

User Request
     โ”‚
     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Orchestrator โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Planner   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Builder   โ”‚
โ”‚              โ”‚     โ”‚             โ”‚     โ”‚             โ”‚
โ”‚ Coordinates  โ”‚     โ”‚ Decomposes  โ”‚     โ”‚ Creates     โ”‚
โ”‚ workflows    โ”‚     โ”‚ tasks       โ”‚     โ”‚ ephemeral   โ”‚
โ”‚              โ”‚     โ”‚ Finds agentsโ”‚     โ”‚ agents      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                                        โ”‚
       โ–ผ                                        โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Agents    โ”‚     โ”‚  Semantic   โ”‚     โ”‚  Guardian   โ”‚
โ”‚             โ”‚โ—„โ”€โ”€โ”€โ–ถโ”‚   Layer     โ”‚โ—„โ”€โ”€โ”€โ–ถโ”‚  Security   โ”‚
โ”‚ Permanent   โ”‚     โ”‚             โ”‚     โ”‚             โ”‚
โ”‚ or Ephemeralโ”‚     โ”‚ Agent Cards โ”‚     โ”‚ OPA Policiesโ”‚
โ”‚             โ”‚     โ”‚ Tool Cards  โ”‚     โ”‚ A2A Auth    โ”‚
โ”‚             โ”‚     โ”‚ MCP Tools   โ”‚     โ”‚ Audit Log   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Core Concepts

AbiCore โ€” FastAPI-style Agent Runner

from my_agent import MyAgent
from abi_core.agent import AbiCore

agent = AbiCore()

@agent.task(name="step1")
def step1(raw_input):
    return {"cleaned": raw_input.strip()}

@agent.task(name="step2", depends_on=["step1"], input_map={"data": "$step1.result"})
def step2(data):
    return {"stored": True}

@agent.tool(name="search")
def search(query):
    """Available to the LLM on demand."""
    return {"results": []}

@agent.mcp_tool(name="bigquery_search", input_map={"query": "$input.user_query"})

agent.run(MyAgent())

AbiAgent โ€” Base Class with Heartbeat

from abi_core.agent import AbiAgent
from config import config

class MyAgent(AbiAgent):
    def __init__(self):
        super().__init__(
            agent_name=config.AGENT_NAME,
            description=config.AGENT_DESCRIPTION,
            llm_config=config.LLM_CONFIG,
            tools=[],
            system_prompt="You are a helpful agent.",
        )
    # stream() inherited with SSE heartbeat + checkpointer memory

ToolExecutionGraph โ€” Deterministic DAG

Tasks registered with @agent.task() are wired into a LangGraph DAG. The LLM never decides execution order โ€” the graph does. Retry, checkpoint/resume, and $reference resolution between nodes are built in.

ToolCards โ€” Governed Tool Discovery

{
  "tool_name": "query_sales_db",
  "description": "Query the sales database",
  "access_scope": {
    "databases": ["sales_db"],
    "tables": ["sales_db.orders", "sales_db.products"],
    "permissions": ["read"],
    "storage": ["s3://company-data/sales/*"],
    "secrets": ["SALES_DB_CONNECTION_STRING"]
  },
  "checksum": "sha256:...",
  "install_key": "tool://query_sales_db@1.0.0"
}

The planner checks access_scope against agent permissions before assigning tools. The guardian validates checksums before execution.

Zombie Container Pattern

Ephemeral agents are cloned from a "zombie" base container. No docker build โ€” just docker run with env vars. The zombie reads SYSTEM_PROMPT, TOOLS, AGENT_PORT from environment and self-configures as a fully functional A2A agent.


Features

  • AbiCore Runner โ€” agent = AbiCore() with auto-config import
  • Decorator API โ€” @agent.task(), @agent.tool(), @agent.mcp_tool()
  • ToolExecutionGraph โ€” LangGraph DAG for deterministic tool execution
  • SSE Heartbeat โ€” Automatic keepalive for CloudFront/proxy compatibility
  • AgentResponse โ€” Typed responses: .success(), .error(), .status(), .input_required()
  • A2AResponse โ€” Clean wrapper for A2A protocol parsing
  • Multi-Provider LLM โ€” Ollama, OpenAI, Anthropic, Bedrock, Azure, Vertex AI, Grok
  • MemorySaver โ€” Conversation memory across clarification rounds
  • MCP Protocol โ€” Streamable HTTP transport with auto-reconnection
  • MCPToolkit โ€” Dynamic tool calling with await toolkit.my_tool(param="value")
  • ToolCards โ€” Tool metadata with access_scope, checksum, and governance
  • Agent Cards โ€” Structured agent metadata for semantic discovery
  • A2A Validation โ€” HMAC-signed agent communication via OPA policies
  • Semantic Layer โ€” Weaviate vector search for agents and tools
  • Guardian โ€” OPA policy enforcement, audit logging, risk scoring
  • Builder โ€” Creates ephemeral agents in Docker containers on demand
  • Zombie Pattern โ€” Fast agent cloning from immutable base image
  • CLI โ€” abi-core create project, abi-core add abi-swarm, abi-core add agent

CLI Commands

# Project
abi-core create project <name> [--with-semantic-layer] [--with-guardian]

# Swarm (planner + orchestrator + builder + prerequisites)
abi-core add abi-swarm

# Agents
abi-core add agent <name> --description "..."
abi-core remove agent <name>

# Services
abi-core add semantic-layer
abi-core add service guardian-native

# Cleanup
abi-core remove abi-swarm

Project Structure

my-project/
โ”œโ”€โ”€ agents/
โ”‚   โ”œโ”€โ”€ planner/          # Task decomposition
โ”‚   โ”œโ”€โ”€ orchestrator/     # Workflow coordination
โ”‚   โ”œโ”€โ”€ builder/          # Ephemeral agent creation
โ”‚   โ””โ”€โ”€ my-agent/         # Your custom agents
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ web_api/          # FastAPI application
โ”‚   โ”œโ”€โ”€ semantic_layer/   # MCP server + Weaviate
โ”‚   โ”‚   โ”œโ”€โ”€ agent_cards/
โ”‚   โ”‚   โ”œโ”€โ”€ tool_cards/
โ”‚   โ”‚   โ””โ”€โ”€ embedding_mesh/
โ”‚   โ””โ”€โ”€ guardian/         # OPA security
โ”œโ”€โ”€ compose.yaml
โ””โ”€โ”€ .abi/runtime.yaml

Documentation

https://abi-core.readthedocs.io


Contributing

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

License

Apache 2.0 โ€” see LICENSE


Built by Josรฉ Luis Martรญnez โ€” Creator of ABI (Agent-Based Infrastructure)

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-1.8.1.tar.gz (265.2 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-1.8.1-py3-none-any.whl (312.6 kB view details)

Uploaded Python 3

File details

Details for the file abi_core_ai-1.8.1.tar.gz.

File metadata

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

File hashes

Hashes for abi_core_ai-1.8.1.tar.gz
Algorithm Hash digest
SHA256 9d050fd8364ddcd69fe04e436639c2d8b16f66b7047fcbb74be9731941fab811
MD5 5ae9de5001dabc80bf7afc0ab9aa0ebe
BLAKE2b-256 7442972830c77c4f32f378b612dd29f5b9e7bc6445380e554b174d0293b23e01

See more details on using hashes here.

File details

Details for the file abi_core_ai-1.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for abi_core_ai-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2637f6083eb55b8f85e46b2f7a96284355c575e0687338c60eeba74e7b8b602e
MD5 fdb7bf39133d2c9546524be3d3a1641b
BLAKE2b-256 2b23be18894a752b3e4c0c5edde21becad13a5fb8bd2284fe29882eeb453287b

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