Skip to main content

Open-source adaptive control plane for production AI agents

Project description

AgentSpine Hero

PyPI - Version Python Postgres Redis License

Open-source adaptive control plane for production AI agents.

AgentSpine is an embedded Python SDK that sits between your AI agents and the tools they use — enforcing policies, preventing duplicates, managing locks, scoring risk, and logging every action for full observability.

Features

  • Policy Engine — Declarative rules that deny, allow, or require approval for agent actions
  • Semantic Deduplication — Prevent agents from repeating the same action using embedding similarity
  • Distributed Locks — Prevent two agents from modifying the same resource simultaneously
  • Risk Scoring — Score every action on a 0–1 scale and route to fast-path, judiciary, or human approval
  • Knowledge Graph — Track relationships between agents, actions, tools, and resources
  • Credential Vault — Encrypted at-rest storage for API keys and OAuth tokens
  • Event Timeline — Append-only audit log of every action and decision
  • Rate Limiting & Circuit Breakers — Per-agent, per-tool, per-workflow limits
  • Feature Flags — Enable only the subsystems you need; disable the rest for zero overhead

Quickstart

# Start infrastructure
docker compose up -d

# Install SDK
pip install agentspine[all]
import asyncio
from agentspine import AgentSpine

async def main():
    spine = AgentSpine(workflow="demo")

    async def local_echo(payload, context):
        return {"echo": payload}

    spine.register_tool("demo.echo", local_echo)

    result = await spine.request_action(
        agent="demo_agent",
        action_type="demo.echo",
        payload={"text": "Hello from AgentSpine!"},
        idempotency_key="demo_001",
    )
    print(f"Status: {result.status}")
    await spine.close()

asyncio.run(main())

If no local tool is registered for an action type, AgentSpine emits a normalized execution signal so an external worker or service can perform the real side effect and report the result back later.

Feature Flags

from agentspine import AgentSpine
from agentspine.features import FeatureFlags

# Full mode (default) — all features on
spine = AgentSpine(workflow="my_workflow")

# Standard — no KG or judiciary
spine = AgentSpine(workflow="my_workflow", features=FeatureFlags.standard())

# Minimal — policy + events only
spine = AgentSpine(workflow="my_workflow", features=FeatureFlags.minimal())

Architecture

Agent → AgentSpine SDK → Pipeline → Tool
           │
           ├── Policy Engine (allow/deny/approve)
           ├── Semantic Dedupe (pgvector)
           ├── Risk Scorer (0-1 score)
           ├── Knowledge Graph (Postgres)
           ├── Distributed Locks (Redis)
           └── Event Timeline (append-only)

Requirements

  • Python 3.11+
  • PostgreSQL 16+ (with pgvector extension)
  • Redis 7+ (optional, for locks/rate-limiting/circuit-breakers)

Documentation

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

Apache 2.0 — See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentspine-0.1.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

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

agentspine-0.1.0-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

Details for the file agentspine-0.1.0.tar.gz.

File metadata

  • Download URL: agentspine-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentspine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ffa5c23279eb04bc557faebe8cd44c5a150755c7e9b740d30d487ece1c4dec9
MD5 b8c1bbb8fc728832c58482bc06ebdf44
BLAKE2b-256 3939fe06724adefd917cc2cddd474264aff22b298e660fa9773267ff48704b54

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentspine-0.1.0.tar.gz:

Publisher: publish.yml on Hrushi11/AgentSpine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentspine-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentspine-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentspine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae9188f8adea2de2852b3a4a50ab705f5840837f1636d6c0fda909b26aabfb85
MD5 b444b89b6d6d264386b33acc1d9e323b
BLAKE2b-256 494db5b40b78ee96672b2ad72bd943cbaaa7d1d01b4ce12685e5190f8195931e

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentspine-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Hrushi11/AgentSpine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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