# Databricks — MemEx: A Programmable Scratchpad for LLM Agents

- Company: Databricks (databricks.com)
- Announced: 2026-05-19T09:01:42+00:00
- Category: developer-tool-release
- Coverage: not counted
- Announcement: yes
- Group: announcements
- Source: https://www.databricks.com/blog/memex-programmable-scratchpad-llm-agents
- Record: https://forck.live/items/25342-memex-a-programmable-scratchpad-for-llm-agents
- Subject: Mosaic AI
- Models affected: Opus 4.6, Sonnet 4.6, Qwen3.5-122B, Qwen3.5-397B

Databricks built MemEx, a programmable Python scratchpad that keeps tool outputs in scope instead of the context window, and validated it inside multiple production and internal agents. The company says its production agents, from Genie to Agent Bricks, run into the same context limitations, because a single SQL query can return millions of rows that ride along in every subsequent turn even if only one cell mattered. MemEx gives the model a typed Python kernel that holds tool outputs, transforms them with code, and materializes only print statements as tokens, so the rollout becomes a self-extending Python program with state kept alive across turns. On hard enterprise structured retrieval tasks, Databricks reports that frontier models like Opus 4.6 and Sonnet 4.6 gain 2 to 5 percentage points at 25 to 30 percent less token cost, while open-weights models Qwen3.5-122B and Qwen3.5-397B nearly double their accuracy at 40 to 50 percent less token cost. Because it can operate over arbitrarily long inputs, MemEx also allows auditing agent trajectories that would not fit in a single context window and parallel thinking across multiple trajectories. MemEx is developed on top of aroll, Databricks' agentic rollouts framework, and plugs into the same agent loop and tools aroll already uses for Tool Calling.

## Evidence

Verbatim from https://www.databricks.com/blog/memex-programmable-scratchpad-llm-agents:

> On hard enterprise structured retrieval tasks, Figure 1 shows that MemEx pushes the cost-vs-accuracy frontier for every model. Frontier models like Opus 4.6 and Sonnet 4.6 gain 2–5 percentage points at 25–30% less token cost.

---

Record: https://forck.live/items/25342-memex-a-programmable-scratchpad-for-llm-agents
Catalogue: https://forck.live/llms.txt
Current issue: https://forck.live/feed.md
