Reusable AgentGraph runtime primitives: agents, graphs, tools, runs, events, artifacts, human gates, schedules, and knowledge ledger.
Project description
AgentGraph Core
AgentGraph Core is a small Python runtime foundation for building observable, human-in-the-loop agent systems.
It provides shared backend primitives for projects that need transparent agent execution, tool auditing, scheduled runs, human review, artifact tracking, and evidence-based knowledge promotion.
Core idea
application UI / API adapter
-> agentgraph-core
-> agent profile
-> graph definition
-> tool registry
-> run lifecycle
-> event stream
-> artifact index
-> human gate
-> schedule
-> knowledge ledger
-> application-specific tools and state authority
Applications keep their own product shape, domain models, and storage authority. AgentGraph Core provides the common runtime contract.
Included
AgentProfile: agent identity, responsibility, model, and knowledge boundary.GraphDefinition: product-visible nodes, edges, and conditional routing contract.ToolDefinition/ToolExecution: tool registry, enable/disable, risk, approval, and execution status.AgentRun: lifecycle, current node, heartbeat, retry, and failure metadata.AgentEvent: frontend-visible event stream.RunArtifact: index for generated artifacts without forcing large payloads into SQLite.HumanGateReview: approve / reject / edit / score / need-more-data gate.KnowledgeRecord/KnowledgeEvidence: candidate -> stable -> rejected ledger.ScheduledJob: manual / cron / event trigger model.SQLiteStore: small deployable persistence layer.build_runtime_graph(...): LangGraph adapter for registered graph definitions.
Excluded
- No frontend.
- No product-specific domain models.
- No product-specific terminology.
- No requirement to replace an application's existing file authority or database.
Install for development
python -m venv .venv
. .venv/bin/activate
pip install -e '.[test]'
pytest -q
Minimal graph
from agentgraph_core import AgentRun, GraphRuntimeSpec, RunStatus, build_runtime_graph, default_entry_node
from examples.catalog.demo_catalog import GRAPH
from examples.demo_runtime import NODE_HANDLERS, ROUTE_HANDLERS
spec = GraphRuntimeSpec(
definition=GRAPH,
entry_node_id=default_entry_node(GRAPH),
node_handlers=NODE_HANDLERS,
route_handlers=ROUTE_HANDLERS,
)
compiled = build_runtime_graph(spec)
result = compiled.invoke({
"payload": {
"run": AgentRun(agent_id="content-operator", graph_id=GRAPH.id, status=RunStatus.running),
"topic": "demo",
"sources": ["demo://source"],
"auto_approve": True,
}
})
Tool registry example
from agentgraph_core import ToolRegistry
from agentgraph_core.models import ToolDefinition, ToolRisk, ToolExecutionRequest
registry = ToolRegistry(
tools=[ToolDefinition(id="echo", name="Echo", description="Echo input", risk=ToolRisk.read)],
handlers={"echo": lambda payload: {"echo": payload}},
)
execution = registry.create_execution(ToolExecutionRequest(tool_id="echo", input={"hello": "world"}))
assert execution.status == "succeeded"
Persistence
Default SQLite path:
data/agentgraph.sqlite3
Override:
AGENTGRAPH_DB_PATH=/path/to/agentgraph.sqlite3
SQLiteStore stores the full run JSON snapshot and mirrors events, artifacts, human decisions, tool executions, knowledge, schedules, and registry definitions into queryable tables.
Application integration pattern
application UI
-> application API adapter
-> agentgraph-core run/event/artifact/human-gate/knowledge layer
-> application-specific tools
-> application-specific state authority
Typical integrations keep large generated content, domain state, or external records in their existing storage system, while using AgentGraph Core for operational visibility and control-plane state.
Development checks
pytest -q
python -m compileall agentgraph_core examples tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentgraph_core-0.1.0.tar.gz.
File metadata
- Download URL: agentgraph_core-0.1.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4f036e6018d81bbfc9a1a6026a841c541674bdd0355538ec776d3e4f9df513a
|
|
| MD5 |
ce157d6ff5f7c2709a9254adeede45d4
|
|
| BLAKE2b-256 |
fcdd3440b3640d770966a57bb9ad55f3b6d197a6d3d93e9660016ac92d96c0b0
|
File details
Details for the file agentgraph_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentgraph_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
613a61965c3549c10dceac8f0a393e214bfd4f6dbae4aa55cffeebdf8f4d2fc4
|
|
| MD5 |
c7a72be0e1efad5d121d5c2f2cdea549
|
|
| BLAKE2b-256 |
a0aa3229eb2e23a521d4c53beddb64461b2dd896108c7fb07e4309f388218202
|