FastAgentic
For FastAPI developers

Same decorators. Agent superpowers.

FastAgentic is a FastAPI extension. If you can write @app.post("/"), you can write @agent_endpoint("/"). Everything you know about dependency injection, Pydantic models, middleware, and testing still applies.

What you get beyond FastAPI

  • Automatic MCP + A2A surfaces — the same function becomes an MCP tool and A2A skill. No duplicate schemas.
  • Streaming without boilerplate — SSE and WebSocket responses from an async generator, with backpressure handled.
  • run_opaque() — wrap existing agent code and get crash-safe resumption without refactoring.
  • Cost tracking middleware — token counts per request, attributed to user/tenant.
  • Policy engine — declarative rate limits and budget caps that compose like FastAPI dependencies.

What stays the same

  • Pydantic 2 request/response models.
  • Depends(), BackgroundTasks, Request, Response — unchanged.
  • OpenAPI/Swagger generation.
  • Uvicorn + Gunicorn deployment.
  • pytest + httpx testing.

Migration path from raw FastAPI

  1. Install: pip install fastagentic[pydanticai]
  2. Replace your FastAPI() app with App().
  3. Swap @app.post@agent_endpoint for agent-bearing routes.
  4. Point your storage adapter at Redis or Postgres for durability.
  5. Keep everything else.

Migrating a large FastAPI codebase to agents?

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.