Skip to main content

Foundations

6 min read

AI Framework Comparison

How Directive compares to popular AI agent frameworks.

Directive's AI adapter doesn't replace your LLM framework – it wraps it with constraint-driven orchestration. This means you keep your existing agent code and gain guardrails, reactive state, time-travel debugging, and declarative patterns on top.


At a Glance

FeatureDirective AILangChain/LangGraphCrewAIAutoGenVercel AI SDK
ApproachConstraint-driven wrapperGraph-based chainsRole-based crewsConversational agentsStreaming-first UI
Framework lock-inNone – wraps any runnerLangChain ecosystemCrewAI agentsAutoGen agentsVercel ecosystem
Reactive stateDirective System backboneLangGraph stateShared memoryChat historyReact state
GuardrailsInput + output + tool-callLangSmith eval
Execution patterns8 built-in (parallel, sequential, supervisor, DAG, race, reflect, debate, goal)LangGraph nodes/edgesSequential/parallelRound-robin chat
ConstraintsDeclarative when/require
Time-travel debugBuilt-in snapshots + forkLangSmith tracing
DevToolsVisual debugger (13 views)LangSmith dashboardAutoGen Studio
StreamingToken-level with backpressureLangChain streamingCore strength
Memory3 strategies + summarizersLangChain memoryCrew memoryChat history
Evals10 built-in criteria + LLM judgeLangSmith evals
Self-healingCircuit breaker + auto-reroute
Goal patternDesired-state goal resolutionGoal-oriented tasks
Pattern checkpointsSave/resume all 8 patternsLangGraph checkpointing
TypeScriptFirst-class, fully typedPython-first, TS portPython onlyPython-first, TS portFirst-class
Bundle sizeTree-shakeable, zero-cost debugLarge dependency treeN/A (Python)N/A (Python)Small

LangChain / LangGraph

LangChain provides a comprehensive toolkit for building LLM applications with chains, agents, and tools. LangGraph adds graph-based orchestration with nodes and edges.

When LangChain is Better

  • You need the broadest ecosystem of integrations (100+ LLM providers, vector stores, tools)
  • Your team is Python-first
  • You want LangSmith's hosted tracing and evaluation platform

When Directive Adds Value

  • You want framework-agnostic orchestration that wraps any LLM SDK
  • You need declarative constraints that automatically trigger agent runs
  • You want reactive state (derivations, scratchpad) that drives UI updates
  • You need visual debugging (Timeline, Cost, State) without a hosted service
  • You want self-healing with automatic agent rerouting

Using Together

Directive can wrap a LangChain runner. Use LangChain for your LLM calls and tool integrations, Directive for orchestration, guardrails, and state management.


CrewAI

CrewAI provides role-based agent teams with tasks, tools, and process flows. Agents have roles, goals, and backstories.

When CrewAI is Better

  • You want the simplest mental model for multi-agent systems
  • Role-based metaphors (researcher, writer, reviewer) fit your use case
  • You're building in Python

When Directive Adds Value

  • You need TypeScript-native orchestration
  • You want per-agent and orchestrator-level guardrails (input, output, tool-call)
  • You need 8 execution patterns beyond sequential and parallel (including goal-directed resolution)
  • You want reactive cross-agent derivations and shared scratchpad
  • You need breakpoints, checkpoints, and time-travel debugging

Directive's goal pattern goes beyond CrewAI's role-based goals. CrewAI goals are natural-language descriptions that guide agent behavior (goal="Identify trending topics"). Directive goals are machine-checkable conditions with dependency resolution, quantitative satisfaction tracking, and progressive relaxation – the runtime knows exactly how close you are to done and can self-correct when progress stalls.


AutoGen

Microsoft's AutoGen enables multi-agent conversations where agents chat with each other to solve problems.

When AutoGen is Better

  • Conversational multi-agent patterns (round-robin, group chat) are your primary use case
  • You want AutoGen Studio's visual builder
  • Your team uses Python

When Directive Adds Value

  • You need structured execution patterns (DAG, race, reflect, debate) beyond conversation
  • You want constraint-driven orchestration with declarative rules
  • You need token budgets, circuit breakers, and self-healing
  • You want a reactive state backbone that drives UI updates
  • You need evals with 10 built-in criteria and LLM-as-judge scoring

Vercel AI SDK

Vercel AI SDK provides streaming-first UI primitives for React, with excellent DX for chatbots and generative UI.

When Vercel AI SDK is Better

  • You're building a chat UI and want the fastest path to streaming responses
  • You want React Server Components integration
  • Your use case is primarily single-agent chat

When Directive Adds Value

  • You need multi-agent orchestration with patterns, constraints, and guardrails
  • You want framework-agnostic state (works with React, Vue, Svelte, Solid, Lit)
  • You need time-travel debugging and visual DevTools (Timeline, Cost, State)
  • You want declarative agent routing based on runtime state
  • You need production features: evals, OTEL, self-healing, goal pattern

Using Together

Use Vercel AI SDK for the streaming UI layer and Directive for backend orchestration, guardrails, and state management.


Migration Cheat Sheets

Quick code mappings from other frameworks to Directive AI.

From LangChain

LangChainDirective
ChatOpenAI({ model })AgentRunner function wrapping your SDK
RunnableSequence.from([a, b, c])sequential(['a', 'b', 'c']) pattern
StateGraph with nodes/edgesdag({ nodes, edges }) pattern
PromptTemplateAgent instructions field
LangSmith tracingdebug: true + DevTools
ConversationBufferMemorycreateMemory({ strategy: 'sliding-window' })
// LangChain
const chain = RunnableSequence.from([retriever, llm, parser]);
const result = await chain.invoke("query");

// Directive
const orchestrator = createMultiAgentOrchestrator({
  runner,
  agents: {
    retriever: { agent: retriever },
    writer: { agent: writer },
  },
  patterns: { pipeline: sequential(['retriever', 'writer']) },
});
const result = await orchestrator.runPattern('pipeline', 'query');

From Vercel AI SDK

Vercel AI SDKDirective
streamText()createStreamingRunner() + createSSETransport()
useChat()useFact(system, 'agent::__agent') + SSE client
tool() definitionstoolCall guardrails for validation
generateText()orchestrator.run(agentId, input)
// Vercel AI SDK
const result = streamText({ model: openai('gpt-4'), prompt: 'Hello' });

// Directive (with SSE transport for streaming)
const streamable = {
  stream: (agentId: string, input: string, opts?: { signal?: AbortSignal }) =>
    streamRunner(agent, input, opts),
};
return transport.toResponse(streamable, 'chat', 'Hello');

From CrewAI / AutoGen

CrewAI / AutoGenDirective
Agent(role=..., goal=...)AgentLike with name + instructions
Task(agent=..., description=...)Agent registration + pattern
Crew(agents, tasks, process)createMultiAgentOrchestrator({ agents, patterns })
crew.kickoff()orchestrator.runPattern('pipeline', input)
Round-robin chatdebate({ agents, evaluator }) pattern

Directive's Unique Differentiators

Features no other framework provides:

  1. Constraint-driven orchestration – Declare when/require rules; the runtime resolves them automatically
  2. Goal pattern – Declare desired end-state with produces/requires declarations; runtime resolves through dependency-ordered agent runs with satisfaction scoring and progressive relaxation
  3. Reactive Directive System backbone – Every agent is a namespaced module with reactive facts, derivations, and effects
  4. Cross-agent derivations – Compute values across all agent states reactively
  5. Visual DevTools – Timeline, Cost, State, DAG, Breakpoints, Compare
  6. Self-healing – Circuit breakers with automatic agent rerouting and health scoring
  7. Pattern checkpoints – Save/resume mid-execution for all 8 pattern types with progress tracking, forking, and diffing
  8. Framework-agnostic – Wraps any AgentRunner function, no LLM SDK lock-in

Next Steps

Previous
Resilience & Routing

Stay in the loop. Sign up for our newsletter.

We care about your data. We'll never share your email.

Powered by Directive. This signup uses a Directive module with facts, derivations, constraints, and resolvers – zero useState, zero useEffect. Read how it works

Directive - Constraint-Driven Runtime for TypeScript | AI Guardrails & State Management