Mastra

Mastra

Build AI agents with a modern TypeScript stack

5.0
1 review

675 followers

From the team behind Gatsby, Mastra is a framework for building AI-powered apps and agents with workflows, memory, streaming, evals, tracing, and Studio, an interactive UI for dev and testing. Start building: npm create mastra@latest
This is the 2nd launch from Mastra. View more

Observational Memory by Mastra

Launching today
Give your AI agents human-like memory
Observational Memory is a SoTA memory system for AI agents - scoring 95% on LongMemEval, the highest ever recorded. It works like human memory: two background agents act as your agent's subconscious, one observing and compressing conversations, the other reflecting and reorganizing long-term memory. It extracts what matters and lets the rest fade - just like you do. Available in Mastra today - with adapters for LangChain, Vercel AI SDK, OpenCode and others coming soon.
Observational Memory by Mastra gallery image
Observational Memory by Mastra gallery image
Observational Memory by Mastra gallery image
Observational Memory by Mastra gallery image
Free
Launch Team
Anima - Vibe Coding for Product Teams
Build websites and apps with AI that understands design.
Promoted

What do you think? …

Alex Booker

Alex from Mastra here (OSS TypeScript AI framework), excited to announce Observational Memory! 🎉

How to get started:

  • Mastra - Releasing today with full support. Give your Mastra agent human-like memory here.

  • Other agent frameworks - Adapters for LangChain, Vercel AI SDK, and more coming soon.

  • Your coding agent - Plugins for OpenCode (PR), etc in the works.

What problem does Observational Memory solve?

If you've built AI agents, you know the memory problem:

  • RAG retrieves context every turn - but it invalidates your prompt cache, adds latency, and costs add up fast.

  • Compaction summarizes when context gets long - but it's lossy and irreversible. Critical details vanish mid-task. Your agent forgets what file it was working on.

  • Long context seems like the answer - until you see the bill and notice performance degrading at the extremes.

Every option forces a tradeoff: memory vs. cost vs. coherence - pick two!

We built Observational Memory to break that tradeoff.

The idea is deceivingly simple: agent memory should work like human memory. You don't remember every character of every file you read. You remember what happened, what you learned, what mattered. Details fade. Important things stick.

OM implements this with two background agents that run as your agent's subconscious. The Observer watches conversations and compresses them into dense, timestamped observations (6-40x token reduction). The Reflector periodically reorganizes long-term memory - combining related items, dropping what's no longer relevant.

The result: a stable, prompt-cacheable context window that scores 95% on LongMemEval - the highest ever recorded. 😱 In our research paper, we outline how we beat the "oracle" (a model given only the conversations containing the answers) - TL;DR dense observations outperform raw context.

Can't wait for you to try it out and, in the meantime, if you have any questions, drop them below and we'll answer them!

Gokul Chandrasekaran

@bookercodes Whenever the agent forgets mid-way through the work, I always think memory is not a new problem; we have always had it since the invention of computers, and we have effectively solved it with short-term and long-term memories, so why we can't apply the same logic here. It is super exciting to see that you guys are going down that path. Congrats and all the best.

Alex Booker

@gokuljd yes, spot on, thank you!