Agent-Based Infrastructure Core - Runtime and CLI
Project description
ABI Swarm ๐ค
ABI-Core-AI โ The open-source framework for building Agent-Based Infrastructure (ABI) โ distributed, self-building multi-agent systems where agents collaborate through semantic context, execute tasks in ephemeral containers, and operate under policy-driven governance.
ABI-Core provides the runtime, CLI, and building blocks to create, deploy, and operate multi-agent swarms from a single pip install. It handles orchestration, planning, ephemeral agent lifecycle, semantic discovery, security validation, and artifact management โ so you can focus on what your agents do, not how they connect.
๐ v1.9+ Released! โ Full E2E pipeline: orchestrator โ planner โ builder โ ephemeral agents โ artifacts. Interactive TUI console. Self-building swarm with
abi-core create swarm.
๐งญ Why ABI?
Most agent frameworks solve the same problem: how to wire an LLM to tools. ABI solves a different one: how to build a system where multiple agents collaborate, self-organize, and operate under governance โ without depending on a single vendor, a single model, or a centralized API.
| ABI-Core | LangGraph / CrewAI / AutoGen | |
|---|---|---|
| Architecture | Distributed swarm with semantic discovery | Centralized graph or crew definition |
| Agent lifecycle | Ephemeral containers โ spawn, execute, self-destruct | Long-running processes |
| Tool discovery | Semantic layer (Weaviate) โ agents find each other by meaning | Hardcoded tool lists or registries |
| Security | OPA policies + Guardian agent + HMAC per request | Varies, usually app-level |
| Model serving | Local-first (Ollama), vendor-agnostic | Typically API-dependent (OpenAI, etc.) |
| Scaffolding | Full CLI: abi-core create swarm generates everything |
Manual setup or minimal templates |
| Governance | Built-in: audit logs, human veto, policy engine | Not included |
| Target | Universities, NGOs, labs, open-source communities | Developers building single-purpose agents |
ABI is not just a framework โ it's an infrastructure paradigm. The agents don't just call tools; they discover each other semantically, negotiate execution plans, spawn ephemeral workers in containers, upload artifacts, and clean up after themselves. All auditable, all governed, all local-first.
Core Principles
- Semantic Interoperability โ Agents share meaning through vector embeddings, not hardcoded routes.
- Distributed Intelligence โ No single model owns the truth. Orchestrator plans, planner decomposes, builder spawns, ephemeral executes.
- Governed Autonomy โ Every action passes through OPA policies and Guardian validation. Humans retain veto power at all times.
- Local-First โ Runs on your hardware with Ollama. No API keys required. No data leaves your network.
โ ๏ธ Beta Release: APIs may change. Some features are experimental. The pipeline is functional end-to-end.
Quick Start
pip install abi-core-ai
# Create a complete swarm (project + all agents + services)
abi-core create swarm --name my-swarm
# Or step by step:
abi-core create project my-system --with-semantic-layer --with-guardian
abi-core add abi-swarm
# Run
abi-core run # Detached (banner + status only)
abi-core run --logs # With container logs
abi-core run --build # Rebuild containers first
Architecture
User Request
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Orchestrator โ
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Triage โ โ Guardian Gate โ Level 0 โ
โ โ (simple/ โ โ (security โ parallel โ
โ โ complex) โ โ validation) โ โ
โ โโโโโโโโฌโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ Gate Decision โ Level 1 โ
โ โ approve/block/ โ merge โ
โ โ respond/plan โ โ
โ โโโโโโโโโฌโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโดโโโโโโโโโโโโโ โ
โ โผ โผ โ
โ Simple Complex โ
โ โ LLM responds โ Planner โ Builder โ
โ directly โ Execute โ Synthesizeโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Semantic โ โ Guardian โ โ MinIO โ
โ Layer โ โ Security โ โ Artifacts โ
โ โ โ โ โ โ
โ Agent Cards โ โ OPA Policiesโ โ Code, Data โ
โ Tool Cards โ โ A2A Auth โ โ Results โ
โ Service Cardsโ โ Audit Log โ โ S3-compat โ
โ MCP Tools โ โ Risk Score โ โ โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
Core Concepts
AbiCore โ FastAPI-style Agent Runner
from abi_core.agent import AbiCore
from my_agent import MyAgent
agent = AbiCore()
@agent.step(name="step1")
def step1(raw_input):
return {"cleaned": raw_input.strip()}
@agent.step(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())
invoke() โ Unified LLM Calls
from abi_core.agent import invoke
# LLM only, no context
result = await invoke(config.LLM_CONFIG, "Classify this query...")
# LLM with conversation memory
result = await invoke(config.LLM_CONFIG, "Summarize...", thread_id=context_id)
# Agent with tools, no context
result = await invoke(config.LLM_CONFIG, "Find agent...", tools=[tool_find_agent])
# Agent with tools and memory
result = await invoke(config.LLM_CONFIG, query, tools=[find, search], thread_id=session_id)
ToolExecutionGraph โ Deterministic DAG with Parallelism
Tasks registered with @agent.step() are wired into a LangGraph DAG. Nodes at the same dependency level execute in parallel. The LLM never decides execution order โ the graph does. Retry, checkpoint/resume, and $reference resolution between nodes are built in.
Three Types of Cards
| Card | Purpose | Example |
|---|---|---|
| AgentCard | Identity for agents (permanent or ephemeral) | Planner, Builder, zombie agents |
| ServiceCard | Identity for non-agent services | Webapp, semantic layer |
| ToolCard | Metadata for MCP tools with access_scope | query_sales_db, send_email |
All cards support HMAC authentication, checksum verification, and OPA policy evaluation.
Zombie Container Pattern
Ephemeral agents run a 3-phase DAG:
- gather_context โ Pull artifacts from MinIO, prepare workspace
- analyze_and_execute โ LLM autonomous with tools (decides what to call)
- synthesize_and_report โ Package results, upload artifacts
No docker build โ just docker run with env vars. The zombie self-configures as a fully functional A2A agent.
Features
- AbiCore Runner โ
agent = AbiCore()with auto-config import - Decorator API โ
@agent.step(),@agent.tool(),@agent.mcp_tool() - ToolExecutionGraph โ LangGraph DAG with parallel execution and Annotated reducers
- invoke() โ Unified LLM calls: LLM-only, agent+tools, with/without context
- SSE Heartbeat โ Automatic keepalive for CloudFront/proxy compatibility
- Session Management โ Auto process_answer(), clear_session(), _yield_clarification() in AbiAgent base
- AgentResponse โ Typed responses:
.success(),.error(),.status(),.input_required() - A2AResponse โ Streaming event parser for TaskArtifactUpdateEvent and TaskStatusUpdateEvent
- Multi-Provider LLM โ Ollama, OpenAI, Anthropic, Bedrock, Azure, Vertex AI, Grok
- MCP Protocol โ Streamable HTTP transport with auto-reconnection
- MCPToolkit โ Dynamic tool calling with ServiceCard or AgentCard auth
- Three Card Types โ AgentCard, ServiceCard, ToolCard with HMAC, checksum, access_scope
- Guardian Gate โ Parallel triage + security validation before any agent executes
- OPA Policies โ Support for agent://, service://, tool:// prefixes and ephemeral agents
- Semantic Layer โ Weaviate vector search for agents, tools, and services
- ArtifactStore โ S3-compatible object storage (MinIO local, AWS S3, GCS production)
- ContainerRuntime โ Docker lifecycle abstraction (run, destroy, health check)
- Builder โ Creates ephemeral agents with register/deregister lifecycle
- Zombie Pattern โ 3-phase DAG: gather โ execute (LLM autonomous) โ report
- Tree of Thoughts โ Planner and Orchestrator prompts with multi-path reasoning
- Infrastructure Filter โ Prevents builder/planner/orchestrator from being assigned as task executors
- CLI โ
abi-core create swarm,abi-core create project,abi-core add abi-swarm,abi-core run
CLI Commands
# Swarm (everything in one command)
abi-core create swarm --name <name>
# Project (step by step)
abi-core create project <name> [--with-semantic-layer] [--with-guardian]
abi-core add abi-swarm
# Run
abi-core run # Detached (banner + status table)
abi-core run --logs # With container logs
abi-core run --build # Rebuild containers
# Agents
abi-core add agent <name> --description "..."
abi-core remove agent <name>
# Services
abi-core add semantic-layer
abi-core add service guardian-native
Project Structure
my-swarm/
โโโ agents/
โ โโโ planner/ # Task decomposition (Tree of Thoughts)
โ โโโ orchestrator/ # Triage + Guardian gate + workflow coordination
โ โโโ builder/ # Ephemeral agent creation + registration
โ โโโ my-agent/ # Your custom agents
โโโ services/
โ โโโ web_api/ # FastAPI application + ServiceCard
โ โ โโโ service_cards/
โ โโโ semantic_layer/ # MCP server + Weaviate
โ โ โโโ agent_cards/
โ โ โโโ tool_cards/
โ โ โโโ service_cards/
โ โโโ guardian/ # OPA security + audit
โโโ compose.yaml # All services + MinIO + OPA
โโโ .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
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 abi_core_ai-1.9.48.tar.gz.
File metadata
- Download URL: abi_core_ai-1.9.48.tar.gz
- Upload date:
- Size: 291.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0259190f41846523f3d3a48aaac9398f06fdb858bba6dbf61f403df179e27c21
|
|
| MD5 |
176bc82c0c4c235be102254340b1fdae
|
|
| BLAKE2b-256 |
c648a3b97d869f0a689be2db8f90c9fd6a1f26474d0293e261bb4e6405c9e1a0
|
File details
Details for the file abi_core_ai-1.9.48-py3-none-any.whl.
File metadata
- Download URL: abi_core_ai-1.9.48-py3-none-any.whl
- Upload date:
- Size: 344.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7434a38bd1498c7a06647f22b84e899f9f79c872fb83398edb63f13f65021a1e
|
|
| MD5 |
d6b59cc83928eac34877392a4db7a278
|
|
| BLAKE2b-256 |
fa5b4c49b1dde9863461a8ce333befdb166405cfb63528dd0ef20aa675ebcc87
|