Open source · Apache-2.0 · Built on Pydantic AI
Firefly Agentic is the production-grade metaframework built on Pydantic AI.
Keep its Agent, Tool and RunContext — gain
lifecycle hooks, delegation, memory, reasoning patterns, validation loops, RAG
and DAG pipelines. Protocol-driven, swappable, no lock-in.
Pydantic AI gives you type-safe, model-agnostic agents. A production system needs more: orchestration, validation-and-retry, memory across turns, traces and budgets, experiments. Firefly Agentic supplies every one of those as a dedicated, swappable layer — so your business logic never couples to infrastructure.
Twelve composable layers. Adopt one, or all of them.
FireflyAgent, registry, a 10-stage middleware chain, and seven delegation strategies.
Protocol or base-class tools, guards, composition, and human-in-the-loop approval.
ReAct, CoT, Plan-and-Execute, Reflexion, Tree of Thoughts, Goal Decomposition.
Conversation history and working memory with token budgets and pluggable stores.
Parse-then-validate retries, LLM-as-judge rubrics, hallucination guards.
Typed DAGs with parallel execution, retries, checkpointing and audit logs.
A code-defined orchestration DSL over agents with budgets and deterministic resume.
Eight embedding providers, six vector stores, auto-embedding and tenant scoping.
Native OpenTelemetry spans & metrics, cost resolution, and budget gates.
Prompt-injection guards, PII/secret redaction, and at-rest encryption.
Decision records, audit trails and human-readable reports for compliance.
A circuit breaker that short-circuits a failing model before it drains budget.
Core → Agent → Intelligence → Experimentation → Orchestration. Higher layers depend on lower ones, never the reverse.
Every extension point is a @runtime_checkable protocol — implement it and the framework discovers your component by duck typing.
Async-first, typed, and decorator-friendly. Here's the shape of it.
from fireflyframework_agentic.agents import FireflyAgent agent = FireflyAgent(name="assistant", model="openai:gpt-4o") result = await agent.run("Summarize this contract in 3 bullets.") print(result.output)
from fireflyframework_agentic.memory import MemoryManager memory = MemoryManager(max_conversation_tokens=32_000) agent = FireflyAgent(name="bot", model="openai:gpt-4o", memory=memory) cid = memory.new_conversation() await agent.run("My name is Alice.", conversation_id=cid) await agent.run("What's my name?", conversation_id=cid) # -> Alice
from fireflyframework_agentic.reasoning import ReActPattern react = ReActPattern(max_steps=5) result = await react.execute(agent, "What's the weather in London?") print(result.output) # structured ReasoningResult + trace
from fireflyframework_agentic.pipeline.builder import PipelineBuilder from fireflyframework_agentic.pipeline.steps import AgentStep, CallableStep pipeline = ( PipelineBuilder("idp") .add_node("classify", AgentStep(classifier)) .add_node("extract", AgentStep(extractor)) .add_node("validate", CallableStep(check)) .chain("classify", "extract", "validate") .build() ) result = await pipeline.run(inputs="Process this document")
Every pattern shares a reason → act → observe → continue template, produces a structured trace, and swaps its output mode per model.
A typed pipeline graph for structure; a Python DSL for deterministic, resumable orchestration. Use either, or both.
Eight embedding providers and six vector-store backends behind one protocol — drop straight into a pipeline with EmbeddingStep and RetrievalStep.
18 hands-on chapters that teach every concept from zero to expert through a real document-processing pipeline.
Start the tutorial → Use caseA focused walkthrough of a seven-phase pipeline: ingest, split, classify, extract, validate, assemble, explain.
Read the walkthrough → ReferenceDetailed guides for every module — agents, tools, reasoning, pipelines, observability and more.
Browse the docs →