Skip to main content

Generic FastAPI service layer for AgentGraph Core.

Project description

AgentGraph API

AgentGraph API is a generic FastAPI service layer for agentgraph-core.

It is intentionally separate from the core runtime package:

  • agentgraph-core: UI-free runtime/control-plane primitives.
  • agentgraph-api: generic HTTP routes, auth hook, JSON serialization, CRUD, and mirror endpoints.
  • Applications provide their own adapters, tools, authentication, and product UI.

Included routes

All generic routes live under:

/api/agentgraph

Current v0 routes:

  • GET /summary
  • GET|POST /agents
  • GET|POST /graphs
  • GET|POST /tools
  • GET|POST /tools/executions
  • GET /tools/executions/{id}
  • POST /tools/executions/{id}/decision
  • GET|POST /runs
  • POST /runs/import
  • GET /runs/{id}
  • GET /runs/{id}/events
  • GET /runs/{id}/artifacts
  • GET /human-gates
  • GET /human-gates/{id}
  • POST /human-gates/{id}/decision
  • GET|POST /knowledge
  • GET /knowledge/{id}
  • GET /knowledge/{id}/evidence
  • POST /knowledge/{id}/decision
  • GET|POST /schedules
  • GET /schedules/{id}
  • POST /schedules/{id}/decision

Health:

  • GET /health

Minimal usage

from agentgraph_api import AgentGraphApiContext, create_app
from agentgraph_core.models import ToolDefinition, ToolRisk

context = AgentGraphApiContext.create(
    db_path="data/my-project-agentgraph.sqlite3",
    tools=[ToolDefinition(id="echo", name="Echo", description="Echo input", risk=ToolRisk.read)],
    tool_handlers={"echo": lambda payload: {"echo": payload}},
    project_name="my-project",
)

app = create_app(context, auth_token="dev-token")

Run:

uvicorn agentgraph_api.app:app --host 127.0.0.1 --port 18889

Auth

create_app(..., auth_token="...") enables a simple Bearer-token dependency for /api/agentgraph/* routes.

Applications can replace this entirely with their own auth layer. AgentGraph API does not own user/session management.

Application adapter pattern

application UI / service
  -> application adapter
  -> agentgraph-api generic routes
  -> agentgraph-core store + policies
  -> application-specific tools and state authority

Use this package when an application wants the standard AgentGraph HTTP surface without copying FastAPI route code into every project.

Development

python -m venv .venv
. .venv/bin/activate
pip install -e '.[test]'
pytest -q
python -m compileall agentgraph_api tests

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

agentgraph_api-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

agentgraph_api-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentgraph_api-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for agentgraph_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 140dbb295a4a7acb798721b719269dd227f908c2721c3612f44267a55b359c9d
MD5 0249db1625fde71c41314b02712c25ca
BLAKE2b-256 8dd97c10c5f36c24bc88da781ff37a0e7850dbcb1a648d6deff433c7e4299476

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentgraph_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for agentgraph_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff3835d3de9ecff50497c49de54fcb459211e47b185d781a338efc768e86b3de
MD5 52307b2075ae9a3acd96f5913991fd72
BLAKE2b-256 4d3a9ea2fd35cb818bc70df4f83973d912d6b5b2e9aa73573637c3b8ddfc2136

See more details on using hashes here.

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