

DSPy vs Letta: Which is Better in 2026?
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
| DSPy | Letta | |
|---|---|---|
| Category | Agent Framework | Agent Framework |
| What it is | Code library: framework for optimizing prompts and LLM programs | Agent server and SDKs: agents with persistent memory |
| Languages | Python | Python and TypeScript SDKs |
| Licence | MIT | Apache 2.0 |
| Managed / paid option | None | Letta API: free tier, Pro $20/month plus usage |
| Project status | Active; 3.x | Active |
| Pricing | Free | Free · paid from $20/mo |
| Starting price | Free tier available | Free tier available |
| Free tier | ||
| Rating | 4.2 | 4.0 |
| Best for | Agent Framework — prompt optimization, evaluation-driven, research-backed | Agent 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
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.