-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started Quickstart
Devrajsinh Gohil edited this page Aug 30, 2026
·
1 revision
This guide walks you through migrating an existing LangGraph workflow to AgentMesh in under 2 minutes.
Define your state schema with channel reducers using typing.Annotated:
import operator
from typing import TypedDict, Annotated, List
class WorkflowState(TypedDict):
query: str
documents: Annotated[List[str], operator.add]
answer: strNodes are standard Python callables that take the state dictionary and return updates:
def retriever(state: WorkflowState) -> dict:
q = state["query"]
return {"documents": [f"Doc 1 for {q}", f"Doc 2 for {q}"]}
def synthesizer(state: WorkflowState) -> dict:
docs = " ; ".join(state["documents"])
return {"answer": f"Synthesized answer based on: {docs}"}Use standard LangGraph StateGraph syntax:
from langgraph.graph import StateGraph
builder = StateGraph(WorkflowState)
builder.add_node("retrieve", retriever)
builder.add_node("synthesize", synthesizer)
builder.add_edge("__start__", "retrieve")
builder.add_edge("retrieve", "synthesize")
builder.add_edge("synthesize", "__end__")Simply replace builder.compile() with agentmesh_adapter.compile(builder):
import agentmesh_adapter
# Compile directly onto bare-metal C++ engine
app = agentmesh_adapter.compile(builder)Invoke synchronously or asynchronously:
# Synchronous invocation
output = app.invoke({"query": "Autonomous Agents", "documents": [], "answer": ""})
print("Result:", output["answer"])
# Asynchronous invocation
import asyncio
async def run_async():
out = await app.ainvoke({"query": "Distributed Consensus", "documents": [], "answer": ""})
print("Async Result:", out["answer"])
asyncio.run(run_async())
```\nGetting Started
How-To Guides
- Compile a Graph
- Annotated Reducers
- Parallel Fanout
- Send() Map-Reduce
- Command() Routing
- Nested Subgraphs
- Async & Streaming
- Checkpointing & State
- Financial Swarm Example
Architecture
- System Overview
- C++ Engine Internals
- O(1) Scheduler
- Dual-Tier Graph
- Persistence & WAL
- Zero-Copy Pybind Bridge
- SOLID Design Principles
API Reference
Benchmarks
Contributing