Skip to main content

ABI-Core

PyPI version Python License Documentation

AI agents that work together — and keep working on Monday.

You've seen the demo. The agent books the flight, writes the code, answers the customer — on stage, in ninety seconds. Then it meets real users, and it invents a refund policy, resets the wrong password, and bills the same order twice. Not because the model is dumb. Because nobody decided where the model stops.

I'm ABI. You write plain Python. The model thinks inside steps you control; your code decides what happens, in what order, and what's allowed. Agents run in their own containers, find each other by what they can do, ask a policy engine before they act, and wait for a person when it matters. Local model by default. Any provider when you want one.

👉 Why ABI-Core — the opinions behind all of this, and the one thing I saved for last.

Beta. The framework works end to end; APIs may still change between minor versions. Pin your version.


Quick start

You need Python 3.11+ and Docker.

pip install abi-core-ai

abi-core create project --name my-system      # answer "n" to the semantic layer and Guardian for now
cd my-system
abi-core add agent --name assistant --description "Answers questions" --with-web-interface
                                               # tasks/skills: answer

Make the agent answer — replace agents/assistant/steps.py with:

from app import agent
from config import config
from abi_core.agent.llm_provider import invoke


@agent.step(name="answer_step", input_map={"query": "$input.query"})
async def answer_step(query):
    return {"answer": await invoke(config.LLM_CONFIG, query)}

Pull a model, start everything, and talk to it:

docker volume create ollama_data              # once per machine; `abi-core run` also creates it
docker compose up ollama -d
docker exec ollama ollama pull qwen3:latest
abi-core run --build

curl -N -X POST http://localhost:8002/stream \
  -H "Content-Type: application/json" \
  -d '{"query": "In one sentence: what is an AI agent?"}'

Want a chat window instead of curl? abi-core add chainlit, then abi-core run, and open http://localhost:8500.

👉 Your First Project walks through it step by step.


The idea: the AI thinks, your code decides

@agent.step(name="classify")
async def classify(message):
    raw = await invoke(config.LLM_CONFIG, f"Reply with one word — faq, order or human: {message}")
    intent = raw.strip().lower()
    return {"intent": intent if intent in {"faq", "order", "human"} else "other"}   # code has the last word

The model reads the message. Code decides what its answer is allowed to be — and everything after it.

  • Steps and tasks. @agent.step functions each do one thing; an @agent.task composes them in plain Python — sequences, branches, asyncio.gather for parallel work. The model never reorders them.
  • Output with a fixed shape. invoke_structured(config, prompt, MyPydanticModel) makes the model fill a schema, enforced while it generates.
  • Rules outside the model. Guardian and OPA evaluate your policies before an action runs. A prompt can be talked around; a policy file can't.
  • A person approves what matters. Plan confirmation shows a plan (or a draft, or an order) and waits for approve / modify / reject — in any language, or with buttons in the chat.
  • Memory and sessions. Session-scoped context, short- and long-term memory, Redis when you run more than one replica.
  • Agents find each other. The Semantic Layer lets an agent ask "who can analyze revenue?" instead of hard-coding an address.
  • Work in the background. @agent.task_async with retries and status, @agent.task_schedule for recurring jobs.
  • Run generated code safely. A throwaway sandbox: no network, no credentials, hard limits.
  • A chat UI that shows its work. Chainlit with live progress, review cards and Google login.

Use cases you can build in under an hour

Each one is a working proof of concept with every file on the page, tested against a local model:

Use case What the model does What code decides
Customer Support & Triage Understands the question, writes the reply Which help-center entry, order lookups, refusing to guess, escalation
Clinical Documentation Turns a visit transcript into a note The note's schema, drugs checked against the transcript, clinician sign-off
Lead Qualification Reads the lead's email, drafts outreach The score, every point explained; nothing is sent without approval
Natural-Language Data Access Turns a question into SQL Read-only access, date ranges, row and time limits
IT Help Desk Understands the request Who may reset what, decided by an OPA policy
Workflow Automation Reads the order email Parallel checks, prices, billing once, background retries
Supply Chain Explains the plan The forecast, reorder points and quantities
Deep Research Takes notes, writes the report Every quote checked word for word, every citation checked

Any model

A generated agent reads its model from the environment — switching provider is a change in compose.yaml, not in code:

environment:
  - LLM_PROVIDER=anthropic          # ollama (default), openai, anthropic, gemini, grok, bedrock, azure, vertex
  - MODEL_NAME=claude-opus-5-5
  - LLM_API_KEY=${ANTHROPIC_API_KEY}
  - 'LLM_EXTRA_PARAMS={"thinking": {"type": "adaptive"}}'   # anything provider-specific, passed as-is

Install the provider's extra in the agent: abi-core-ai[anthropic], [openai], [gemini], [grok], [bedrock], [vertex] — or [providers] for all of them. See Model Serving.


The CLI

abi-core create project --name <name> [--with-semantic-layer] [--with-guardian]
abi-core add agent --name <name> --description "..." [--with-web-interface]
abi-core add service semantic-layer | mcp-api | agent-memory
abi-core add chainlit                 # chat UI as a Docker service
abi-core add policies --name <name>   # starter OPA policy (needs Guardian)
abi-core run [--build] [--logs]

Full reference: CLI Reference.


Reference agents

abi_agents ships the Orchestrator, Planner and Builder — the pieces behind ABI Swarm, which turns one request into a plan, waits for your approval, and creates the agents it's missing. They're alpha, and not scaffolded by a single command: use them as a reference and wire each one into your project. See Planner & Orchestrator.


Contributing

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

License

Apache 2.0 — see LICENSE.


Built by José Luis Martínez.

Metadata

Release files for abi-core-ai 1.13.77

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

Source distribution (sdist)

Source distribution for abi-core-ai 1.13.77
File Size Uploaded
abi_core_ai-1.13.77.tar.gz 573.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for abi-core-ai 1.13.77
File Interpreter ABI Platform
abi_core_ai-1.13.77-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / abi_core_ai-1.13.77.tar.gz

Download URL abi_core_ai-1.13.77.tar.gz
Size 573.2 kB
Tags Source
SHA-256 checksum
How to use checksums
73019257998a98ed4006e7c48a3ab42ef7a14c55a8242c55584af6996d2250c4
BLAKE2b-256 checksum
How to use checksums
790c54638449d806589918416b337d7cfe43ee8bd82fcaa10c8d2e5e1492286b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / abi_core_ai-1.13.77-py3-none-any.whl

Download URL abi_core_ai-1.13.77-py3-none-any.whl
Size 622.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d7bce5dc53c07efca5108120d23b17d36728caafac7d8b9f0365bd07cbac12d
BLAKE2b-256 checksum
How to use checksums
d8b711bcd9824e77fa350f447a7b6863251855bef88483e912056ff94d58cd00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.13.77 This release

2 release files

1.13.8

2 release files

1.13.7

2 release files

1.13.6

1 release file

1.13.5

2 release files

1.13.4

2 release files

1.13.3

2 release files

1.13.2

2 release files

1.13.1

2 release files

1.13.0

2 release files

1.12.9

2 release files

1.12.8

2 release files

1.12.7

2 release files

1.12.6

2 release files

1.12.5

2 release files

1.12.4

2 release files

1.12.3

2 release files

1.12.2

2 release files

1.12.0

2 release files

1.11.9

2 release files

1.11.8

2 release files

1.11.7

2 release files

1.11.6

2 release files

1.11.5

2 release files

1.9.48

2 release files

1.9.47

2 release files

1.9.46

2 release files

1.9.45

2 release files

1.9.44

2 release files

1.9.43

2 release files

1.9.42

2 release files

1.9.41

2 release files

1.9.40

2 release files

1.9.39

2 release files

1.9.9

2 release files

1.9.8

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.3

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.6

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.11

2 release files

1.5.10

2 release files

1.5.9

2 release files

1.5.7

2 release files

1.5.5

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.1.0

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