vs

DSPy vs Letta: Which is Better in 2026?

Agent Framework

Choosing between DSPy and Letta? Both are popular agent framework tools. Below we compare them on pricing, free tiers, features, and pros & cons so you can pick the right fit for your stack.

DSPy is for: Teams with an evaluation set who want to optimize prompts and LLM pipelines against a metric instead of hand-tuning them.

Letta is for: Teams building agents that must remember users and context across sessions and restarts, with memory as the core design.

Quick verdict

There’s no single winner; pick on your constraint. Choose DSPy if you have examples and a metric, and want prompts tuned automatically. Choose Letta if your agent must remember users and past sessions over weeks or months.

DSPy vs Letta — Side by Side

DSPyLetta
CategoryAgent FrameworkAgent Framework
What it isCode library: framework for optimizing prompts and LLM programsAgent server and SDKs: agents with persistent memory
LanguagesPythonPython and TypeScript SDKs
LicenceMITApache 2.0
Managed / paid optionNoneLetta API: free tier, Pro $20/month plus usage
Project statusActive; 3.xActive
PricingFreeFree · paid from $20/mo
Starting priceFree tier availableFree tier available
Free tier
Rating4.24.0
Best forAgent Framework — prompt optimization, evaluation-driven, research-backedAgent Framework — long-term memory, stateful agents, self-host or hosted

Pros & Cons

  • Replaces prompt tinkering with measurable optimisation
  • Strong research backing (Stanford)
  • Composes well with any model provider
  • A genuinely different mental model to learn
  • Optimisation runs cost tokens
  • Memory is the design centre, not an add-on
  • Agents survive restarts with state intact
  • Comes from the MemGPT paper
  • Younger project with a moving API
  • Memory model is opinionated

Key Features Compared

DSPy

  • Signatures and modules replace hand-written prompts
  • Optimizers, including GEPA, that tune prompts against your metric
  • Works with most model providers
  • From Stanford NLP
  • MIT licence

Letta

  • Persistent, self-editing agent memory (from the MemGPT research)
  • Agents keep their state across restarts
  • Self-hosted server, or the hosted Letta API
  • Hosted plans: free tier and Pro at $20 a month with pay-as-you-go usage
  • Letta Code, an open-source coding agent with memory across sessions
  • Apache 2.0 licence

Choose DSPy if…

  • You have examples and a metric, and want prompts tuned automatically.
  • Your pipeline keeps breaking when you switch models, and you want to re-optimize instead of rewriting prompts.

Choose Letta if…

  • Your agent must remember users and past sessions over weeks or months.
  • You want agents that keep state when the process restarts.
  • You want the choice of self-hosting or a hosted API.

Frequently Asked Questions

Is DSPy better than Letta?⌄

There’s no single winner; pick on your constraint. Choose DSPy if you have examples and a metric, and want prompts tuned automatically. Choose Letta if your agent must remember users and past sessions over weeks or months.

What is the difference between DSPy and Letta?⌄

What it is — DSPy: Code library: framework for optimizing prompts and LLM programs. Letta: Agent server and SDKs: agents with persistent memory. Languages — DSPy: Python. Letta: Python and TypeScript SDKs. Licence — DSPy: MIT. Letta: Apache 2.0. Managed / paid option — DSPy: None. Letta: Letta API: free tier, Pro $20/month plus usage. Project status — DSPy: Active; 3.x. Letta: Active.

DSPy vs Letta: which is cheaper?⌄

DSPy pricing: Free. Letta pricing: Free · paid from $20/mo. Confirm current pricing on each tool's official site, as plans change.

Which is rated higher, DSPy or Letta?⌄

In our catalog, DSPy rates 4.2 out of 5 and Letta rates 4.0 out of 5, so DSPy has a slight edge on reviews.

When should I skip both DSPy and Letta?⌄

Skip DSPy if you don’t have an evaluation set yet. DSPy’s optimizers need one to work. Skip Letta if you only need short-lived task agents. A lighter SDK is simpler.

Sources · tool facts checked October 2026

  1. 1.DSPy 3.3.1 release notesnewreleases.io
  2. 2.Letta Code (Letta docs)docs.letta.com

See more options in our guide to the best agent framework tools for startups.

Still not sure which to pick?

Get a free, AI-powered tech stack — including the best agent framework pick for your budget and team — in 60 seconds.

Build my stack free