Skip to main content

AgenticPlanning Python SDK

Thin Python wrapper around the aplan FFI library via ctypes.

Install

pip install agentic-planning

Requires the aplan shared library (.so/.dylib/.dll) on your library path, or the aplan binary on PATH for CLI-mode fallback.

Quick Start

from agentic_planning import PlanningGraph

graph = PlanningGraph("project.aplan")

Goals

# Create a goal
goal = graph.create_goal("Ship v1", intention="Persistent intention infrastructure")
print(goal["id"])

# List all goals
goals = graph.list_goals()
for g in goals:
    print(f"{g['title']} — {g['status']} (momentum: {g['momentum']:.2f})")

# Update goal status
graph.activate_goal(goal["id"])
graph.complete_goal(goal["id"])

# Record progress
graph.record_progress(goal["id"], percentage=45, note="API endpoints done")

# Get goal with computed feelings
detail = graph.get_goal(goal["id"])
print(f"Urgency: {detail['feelings']['urgency']:.2f}")
print(f"Neglect: {detail['feelings']['neglect']:.2f}")

Decisions

# Create a decision linked to a goal
decision = graph.create_decision(
    title="Use PostgreSQL vs SQLite",
    goal_id=goal["id"],
    options=["PostgreSQL", "SQLite", "Both with abstraction layer"]
)

# Crystallize (choose an option)
graph.crystallize_decision(
    decision["id"],
    chosen="SQLite",
    reasoning="Simpler deployment, sufficient for planning state sizes"
)

# Query past decisions
history = graph.list_decisions(goal_id=goal["id"])
for d in history:
    print(f"{d['title']} — {d['status']}")

Commitments

# Create a commitment
commitment = graph.create_commitment(
    title="Deliver API docs by Friday",
    stakeholder="team-lead",
    stakeholder_weight=0.8,
    due_date="2026-03-07T17:00:00Z"
)

# Check at-risk commitments
at_risk = graph.list_commitments(status="at_risk")
for c in at_risk:
    print(f"AT RISK: {c['title']} (due: {c['due_date']})")

# Fulfill or break
graph.fulfill_commitment(commitment["id"])
# graph.break_commitment(commitment["id"], reason="Requirements changed")

Singularity

# Get the unified field view of all goals
singularity = graph.get_singularity()
print(f"Center: {singularity['center']}")
print(f"Themes: {singularity['themes']}")
print(f"Golden path: {singularity['golden_path']}")

# Check for tensions between goals
for tension in singularity["tensions"]:
    print(f"Tension: {tension['goal_a']} <-> {tension['goal_b']}")

Blockers and Prophecy

# Scan for blocked goals
blockers = graph.scan_blockers()
for b in blockers:
    print(f"{b['goal_title']} blocked by: {b['blocker_description']}")

# Listen for progress echoes
echoes = graph.listen_echoes()
for echo in echoes:
    print(f"Echo: {echo['source_goal']} -> {echo['affected_goal']}: {echo['effect']}")

File Persistence

# Save current state
graph.save()

# Load from file
graph = PlanningGraph("project.aplan")

# The .aplan file is portable — copy it anywhere
import shutil
shutil.copy("project.aplan", "/backup/project.aplan")

Error Handling

All methods raise PlanningError on failure:

from agentic_planning import PlanningError

try:
    graph.complete_goal("nonexistent-id")
except PlanningError as e:
    print(f"Error code: {e.code}")  # e.g., 4 (NotFound)
    print(f"Message: {e.message}")

Error codes match the FFI AplanResult enum:

Code Name Meaning
0 Ok Success
1 NullPointer Internal null pointer
2 InvalidUtf8 Bad string encoding
3 EngineError Engine-level failure
4 NotFound Entity doesn't exist
5 ValidationError Invalid input
6 IoError File I/O failure
7 SerializationError JSON error

Metadata

Release files for agentic-planning 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentic-planning 0.1.0
File Size Uploaded Provenance
agentic_planning-0.1.0.tar.gz 6.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentic-planning 0.1.0
File Interpreter ABI Platform
agentic_planning-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / agentic_planning-0.1.0.tar.gz

Download URL agentic_planning-0.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
42c82ef72499d45cd167238f7282be3fedd03dd3e3eca51f0359f84a96f84cb8
BLAKE2b-256 checksum
How to use checksums
996b8e2ee5ca96a0d54382e951e0ac6aae06460e0b5c9bf06d347440dde5bfa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / agentic_planning-0.1.0-py3-none-any.whl

Download URL agentic_planning-0.1.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19dfc19dc8075841b833d4bfc9556c4c08a4b1eec1f9eb7f8bc97a59adef2b3d
BLAKE2b-256 checksum
How to use checksums
c48f7e5dbd81d5ed1bd4afbbe63027bcd7d7b260babe388f9f05b9632a3cd394
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for agentic-planning 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page