/\ ATFGraph /docs
README Downloads
Examples / ATFGraph
Framework reference

This article is retained from the existing framework docs. Self-hosting commands and server-admin access differ from the managed CLI workflow. Start with Get started for the installed product.

Offline mesh

Directory examples/python/features/offline_mesh

Host concierge and fares in one process with atfgraph.offline.OfflineMesh. It executes nested calls without a graph server. The offline-mesh test suite checks this local mode; it has different persistence and API coverage from the shared server.

Capabilities

CapabilityKindSignatureModuleSummary
plantraversal(origin: str, cities: List[str], nights: int = 2) -> dictexamples/python/features/offline_mesh/agent.pyQuote each leg through the fares node, keep the itinerary in session memory, return the cost tree.
quoteskill(origin: str, destination: str, nights: int = 1) -> dictexamples/python/features/offline_mesh/agent.pyDeterministic fixture fare; records usage as if a pricing model had been consulted.
recalltraversal() -> dictexamples/python/features/offline_mesh/agent.pyRead the itinerary the session remembered (empty outside a session that planned one).

Commands

Taken from this example's own README and module docstrings.

python -m atfgraph.worker --module examples.python.features.offline_mesh.agent:concierge
python -m atfgraph.worker --module examples.python.features.offline_mesh.agent:fares
python -m examples.python.features.offline_mesh.run
python -m examples.python.features.offline_mesh.run --serve 127.0.0.1:8765    # optional uvicorn
python -m examples.python.features.offline_mesh.run --serve 127.0.0.1:8765   # needs the optional uvicorn

Files

  • examples/python/features/offline_mesh/README.md
  • examples/python/features/offline_mesh/__init__.py
  • examples/python/features/offline_mesh/agent.py
  • examples/python/features/offline_mesh/agentnode.yaml
  • examples/python/features/offline_mesh/run.py

Note: More than one agent node is declared in this directory; capabilities are listed without a single label.

README

Rendered from examples/python/features/offline_mesh/README.md; the source file is not modified.

Host concierge and fares in one process with atfgraph.offline.OfflineMesh. It executes nested calls without a graph server. The offline-mesh test suite checks this local mode; it has different persistence and API coverage from the shared server.

PieceWhat it shows
OfflineMesh([concierge, fares])each node mounted as an ASGI sub-app at /{node_id} of one root ASGI app (/health, /nodes, /{node}/health, /{node}/definition, POST /{node}/capabilities/{name})
mesh.invoke("concierge.plan", ..., session_id="trip-1")dispatch through the ASGI app; failures raise the usual TraversalFailed / TraversalCancelled / TraversalTimedOut
await concierge.traverse("fares.quote", ...) inside the handlera nested child executed in-process by the other node, with its own task-local ExecutionContext (parent step, inherited root and session, real local lease)
fares.memory.set(...) / concierge.memory.get(...)the mesh's in-memory store, scoped exactly as the SDK selects (session → workflow → global)
record_usage + app.execution_cost()per-execution tracker, usage progress events, offline usage store, child usage propagated into the parent
mesh.discoverythe normal AgentMesh facade over the offline registry
mesh.submit(...) → Handlepoll, cancel, path(), event_log(), events() through mesh.client()
python -m examples.python.features.offline_mesh.run
python -m examples.python.features.offline_mesh.run --serve 127.0.0.1:8765    # optional uvicorn
curl -s -X POST localhost:8765/concierge/capabilities/plan -H 'x-atfgraph-session-id: t1' \
     -d '{"origin":"BNE","cities":["SYD"]}'

You can also serve the same Agent definitions as normal outbound workers, for example through examples.python.features.offline_mesh.agent:concierge. Server mode provides the shared runtime rather than the local in-memory graph.

What offline means here

  • Local execution never claims a remote lease. The offline graph issues and checks its own leases for nested calls, progress, usage and checkpoints; invalid leases return 409.
  • Unsupported routes, including approvals, knowledge, vector search, publications and retention, return 501 offline_unsupported. Inspect mesh.graph.unsupported to see which were attempted.
  • State exists only for the mesh lifetime and does not survive process loss.
  • Fares are deterministic fixtures; no supplier or model is contacted.
ATFGraph documentationHosted workflow · Framework reference