Skip to content

Framework support

Agent Assembly governs third-party agent frameworks without those frameworks needing to be aware of it. You call init_assembly() once; the SDK detects which supported frameworks are importable in your process and installs governance hooks for each, in priority order (see Core Concepts).

This page is the adapter ↔ example status reference for the Examples section. For the shared run instructions, see Preparing the runtime environment; for a detailed, source-grounded walkthrough of each example, follow the per-framework pages linked from the Examples overview.

The universal pattern

The integration is the same for every framework — there is no per-framework setup call:

from agent_assembly import init_assembly

with init_assembly(
    gateway_url="http://localhost:7391",
    api_key="dev-key",
    agent_id="my-agent",
    mode="sdk-only",
):
    # Build and run your agent exactly as you normally would.
    # Every tool call now passes through the policy gate and is audited.
    ...

Inside the with block, the relevant adapter has monkey-patched the framework's tool-call entry points. On exit, all hooks are removed in reverse order.

Supported frameworks

Each framework below ships an adapter under agent_assembly/adapters/. The Runnable example column reflects whether a complete, validated example exists today — either inline in this guide or as a curated script in the central agent-assembly-examples repository.

Framework Adapter Runnable example
LangChain agent_assembly.adapters.langchain ✅ Validated — see Quick start below (runs offline against a mock LLM), plus the LangChain basic agent and LangChain research agent pages.
LangGraph agent_assembly.adapters.langgraph ✅ Validated — see LangGraph node-level governance (state-graph governance; wraps the compiled StateGraph).
CrewAI agent_assembly.adapters.crewai ✅ Validated — see CrewAI research crew (multi-agent crew).
OpenAI Agents agent_assembly.adapters.openai_agents ✅ Validated — see OpenAI Agents SDK.
Pydantic AI agent_assembly.adapters.pydantic_ai ✅ Validated — see Pydantic AI.
Google ADK agent_assembly.adapters.google_adk ✅ Validated — see Google ADK.
LlamaIndex no native adapter ✅ Validated (manual wrapper) — see LlamaIndex — manual tool policy; governs FunctionTool calls via GovernedToolRunner.
MCP servers agent_assembly.adapters.mcp ⏳ Planned — adapter ships; a curated example is not yet vendored.

Adapter present vs. example present

Every framework above has an adapter that is implemented and registeredinit_assembly() will detect and hook the framework whenever it's installed, regardless of the example status. A ✅ row additionally has a curated, end-to-end runnable example you can clone and run. A ⏳ row (currently only MCP servers) means the adapter ships but a runnable example is not yet vendored. Contributions adding one are welcome; see CONTRIBUTING.md.

LangChain quick start

A governed LangChain ReAct agent that runs offline against a mock LLM — no real API keys and no network calls. Install the SDK plus LangChain:

pip install agent-assembly langchain langchain-community
from langchain.agents import AgentExecutor, create_react_agent
from langchain.tools import Tool
from langchain_community.llms import FakeListLLM
from langchain_core.prompts import PromptTemplate

from agent_assembly import init_assembly

with init_assembly(
    gateway_url="http://localhost:7391",
    api_key="dev-key",
    agent_id="quickstart-agent",
    mode="sdk-only",
):
    llm = FakeListLLM(responses=[
        "Thought: I should look up the user.\nAction: whoami\nAction Input: alice\n",
        "Thought: I have the answer.\nFinal Answer: alice is in engineering\n",
    ])
    tools = [Tool(name="whoami", func=lambda name: f"{name} is in engineering", description="who")]
    prompt = PromptTemplate.from_template(
        "Use the tools.\n{tools}\nTool names: {tool_names}\nQ: {input}\n{agent_scratchpad}"
    )
    executor = AgentExecutor(agent=create_react_agent(llm, tools, prompt), tools=tools, max_iterations=2)
    print(executor.invoke({"input": "Which team is alice on?"})["output"])

The same snippet lives in the repository README and is the canonical, validated example. See the examples/ directory for additional in-repo runnable scripts and their status.

More runnable examples

Curated, end-to-end examples for each framework live in the central agent-assembly-examples repository. Each directory is a self-contained, cloneable project. This section documents each one in detail — start with Preparing the runtime environment, then follow the per-framework page: