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

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentspine-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 34d2c907e2338f071e877e039fe5504076b73da61c0d68c8b6308da06e4d78e4
MD5 041cdae6289bca24ade1b09360190d2d
BLAKE2b-256 96bc07f2f9580c5fcac5ee065a6e968c4fc042bf9d195f3211cfe2a86b9a4047

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: agentspine-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fd124456567548eb4df370871c87783ef3583c0e3bfeba779e4129869766d342
MD5 76b601433079d9dfd279f8ae7776fea2
BLAKE2b-256 1ff6e22f27ddde3ee0409af6bea024a1862de1a456c0939a9c97c5686278b2fb

See more details on using hashes here.

Provenance

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