How FastAgentic works
FastAgentic sits between your agent framework and your users. Every request flows through one pipeline — protocols, governance, durability — before it reaches your agent, and back again on the way out. Here's the full path, and the five steps to get there.
The same pipeline runs in reverse for the response — including token streaming, cost accounting, and checkpoint commits.
Five steps to production
- 1Install
Add FastAgentic to your project with pip install fastagentic. It brings FastAPI and the adapter interfaces with it.
- 2Wrap your agent
Pass your existing PydanticAI, LangGraph, CrewAI, or LangChain agent to the matching adapter — or run_opaque() to wrap it unchanged.
- 3Declare an endpoint
Decorate an async function with @agent_endpoint. FastAgentic emits a REST route, an MCP tool, and an A2A skill from that single definition.
- 4Configure durability & governance
Point StepTracker at Redis, Postgres, or S3, and set auth, RBAC, cost budgets, and PII masking through configuration.
- 5Run and observe
Start the app; OpenTelemetry spans, structured logs, and per-run cost tracking flow to Langfuse, Portkey, or Datadog automatically.
One file. Every protocol.
A PydanticAI agent, exposed over REST, MCP, and A2A — with auth, durability, and cost tracking baked in. That's it. That's the app.
from fastagentic import App, agent_endpoint
from fastagentic.adapters import PydanticAIAdapter
from pydantic_ai import Agent
agent = Agent("openai:gpt-4o", system_prompt="You are a helpful research assistant.")
app = App(title="Research Service")
@agent_endpoint("/research", adapter=PydanticAIAdapter(agent))
async def research(query: str) -> str:
"""Answer research questions with cited sources."""
...
# One decorator gives you:
# POST /research (REST + streaming SSE)
# MCP tool research(query) (Model Context Protocol)
# A2A skill research (Agent-to-Agent)
# + auth, cost tracking, checkpoints, OpenTelemetry Need FastAPI, LangGraph, or agent platform expertise?
Neul Labs — the team behind FastAgentic — takes on a limited number of consulting engagements each quarter. We help teams ship agents to production, fix broken LangGraph pipelines, and design governance for multi-tenant LLM platforms.