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.7.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.7-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentspine-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 59a33a3d09fdde5890438710697ad0087b5f5d4b449ba63c5aeb16862e06c656
MD5 078e59829dc065bcddae155f03481e83
BLAKE2b-256 74915c14319ec18929e28f84eb41d2a6ef28f0eb0f4e2aa7ba7568b52f6f26b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentspine-0.1.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: agentspine-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 50.7 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cf403e16ad503efdf73793f7c1dd02cce39955a8df7c7672adb5adc03dfd39a4
MD5 49dfd57366dc70d09dea1fb490da5cc5
BLAKE2b-256 772735a600edd1bb26d2df3c1f66c50c3ca77c226da4aec9e9e212ce3797b3fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentspine-0.1.7-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