Your personal memory, across sessions, agents, and devices.

LlamaIndex Workflows: How They Run and Remember

memU Team memU Team

LlamaIndex Workflows is the orchestration layer inside LlamaIndex. You write async steps that pass typed events to each other, and the framework routes each event to the step that accepts it. LlamaIndex introduced Workflows as a beta on August 1, 2024. In October 2026 the standalone package was at version 2.26.1. Multi-agent setups run on it through AgentWorkflow. Once a run returns, its state is gone unless you snapshot it or add Memory.

What are LlamaIndex Workflows, in one sentence?

LlamaIndex Workflows is an event-driven, step-based Python framework for controlling how an AI application or agent moves from one step to the next.

That follows the Workflows documentation, which calls a workflow "an event-driven, step-based way to control the execution flow of an application." The package is MIT-licensed and installs with pip install llama-index-workflows. It also ships inside llama-index-core.

Workflows replaced Query Pipelines, LlamaIndex's earlier DAG API. The launch post explains that adding loops to a graph made pipelines hard to read and debug. The team asked "why a DAG may not be the right fit" for agents and moved to events.

How do LlamaIndex Workflows differ from LangGraph?

LangGraph is the closest alternative. Both run agent loops with shared state, and neither saves anything by default. They differ in how steps are routed and in the persistence that ships built in.

LlamaIndex Workflows LangGraph
Unit of work A step that takes one event type and returns another A node in a graph with explicit edges
Routing By the event type in each step's annotations By the edges you declare
Shared state in a run The context store The graph state
Persistence by default None. State is gone once the run returns None unless you compile with a checkpointer
Built-in persistence Snapshot with to_dict, or a runtime plugin such as DBOS In-memory, SQLite and Postgres checkpointers
Long-term memory The Memory class with memory blocks A Store for data shared across threads

Sources: LlamaIndex's durable workflows guide and memory guide, and LangGraph's persistence docs.

How does a LlamaIndex workflow run?

Each step is a method marked with the @step decorator. Events are Pydantic classes. When you call run(), the framework emits a start event, and your keyword arguments become its fields. A step returns an event, which triggers whichever step accepts that type. Returning a stop event ends the run, and its result can be any object.

The framework checks the event graph before the run starts. The docs say it catches a missing stop event or events that no step produces or consumes, so wiring mistakes surface before any LLM call is spent.

Inside a run, steps share a context object. Its store holds state for that single run. A step can also send events on the fly or wait for a set of events to arrive. Clients and models go in a Resource, which keeps them out of the saved state. Calling run returns a handler. You can await it for the result or stream events from it while the run is in progress.

How do multi-agent workflows work in LlamaIndex?

LlamaIndex ships a ready-made workflow for agents called AgentWorkflow. Its multi-agent guide describes three patterns.

The first is AgentWorkflow itself. You pass a list of agents and name a root agent. Each agent lists the agents it may hand off to. The root agent takes the user message and may pass control to another agent. That repeats until one agent gives a final answer.

With an orchestrator, you wrap each specialist agent as a tool and give the tools to a top-level agent. Control always returns to the orchestrator, so you keep a firmer grip on the sequence.

A custom planner goes furthest. An LLM writes a plan, which your code parses before calling each agent in turn. You get full flexibility and must build streaming, state handling and human checkpoints yourself. The guide suggests starting with AgentWorkflow and moving down the list only when a pattern cannot express your flow.

For deployment, LlamaIndex now groups Workflows under LlamaAgents. Its CLI, llamactl, serves workflow apps locally. It can also deploy them to LlamaCloud or export them for self-hosting.

What does a workflow remember after it finishes?

By default, nothing. The durable workflows guide says workflows are ephemeral: once run returns, the state is gone. Snapshots let a crashed run resume. Memory carries facts into later runs.

Durable runs: surviving a crash

A run's context can be saved and restored. The to_dict method snapshots the events in flight plus the state store. You rebuild it with from_dict and pass it back to run, even in another process. There is no built-in checkpointer. You take snapshots yourself, usually whenever a step finishes. The DBOS runtime plugin is the alternative: it journals step transitions to a database so a crashed run can resume.

Resume is at least once. A step that was running when the snapshot was taken runs again from the top. So step side effects must be safe to repeat. Instance attributes are not saved, and one value that cannot be serialized makes the whole snapshot fail.

Memory: carrying facts into the next run

To carry facts from one run into the next, LlamaIndex has a Memory class, described in the memory guide. Short-term memory is a first-in, first-out message queue. The default token limit is 30,000, and chat history may use 70% of it. Older messages flush into long-term memory blocks.

There are three built-in blocks. The static block holds fixed text. For facts, an extraction block has an LLM pull them out of chat, up to a set maximum. The vector block stores and retrieves whole message batches. By default, Memory uses an in-memory SQLite database, which is lost when the process exits. Point it at a remote database and reuse the session ID to keep it.

What should you watch for in production?

A Memory object is not serializable, so it travels separately from the workflow context. Because resume is at least once, a step that sends email can fire twice unless you guard it. And the default store lives in memory: a demo that seems to remember will forget on redeploy.

The docs make few performance claims, and we found no independent benchmark of Workflows against LangGraph. Choose on how the API fits your code, and test persistence by killing a run halfway.

The bottom line

LlamaIndex Workflows fits teams that already use LlamaIndex for retrieval and want typed, event-driven control flow around it. For multi-agent work, start with AgentWorkflow. Add snapshots or the DBOS plugin before any long run reaches production. Back Memory with a real database from the first deploy.

How do you keep what agents learn across runs and tools?

Workflow memory in LlamaIndex lives inside your app. The fact extraction block stores what an LLM picked out of chat, keyed to a session. That serves the app's end users. The developer building the app has a separate gap: their coding agents relearn the same project facts each session. Claude Code and Codex each keep their own context, and neither sees what LlamaIndex stored.

memU is a shared memory for those coding agents. A scheduled background task slices new session logs into jobs. The agent distills them into memory and skill Markdown, and memU commits the files. memU's memory service makes no LLM or chat calls. It stores and embeds the Markdown the agent prepared, then retrieves it. A standing instruction in CLAUDE.md or AGENTS.md tells the agent to retrieve before answering. Every host reads the same backend, so a fix for a workflow bug that one agent learned is there for the next.

The hosted version on memu.so is free and syncs across devices. Get an API key there and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

The self-hosted setup and the support matrix are in the memU GitHub repository.

FAQ

Are LlamaIndex Workflows open source?

Yes. The llama-index-workflows package is MIT-licensed on PyPI. It also ships inside llama-index-core.

Do LlamaIndex Workflows save state between runs?

Not by default. State is gone once a run returns. To resume runs, snapshot the context yourself or use the DBOS runtime plugin. To carry facts forward, use the Memory class with a database.

What is AgentWorkflow in LlamaIndex?

AgentWorkflow is a built-in workflow that runs several agents with handoffs. You name a root agent, and each agent lists which others it may pass control to.

Is ChatMemoryBuffer deprecated?

Yes. LlamaIndex's memory guide marks ChatMemoryBuffer as deprecated in favor of the Memory class.

Can I use LlamaIndex Workflows without the rest of LlamaIndex?

Yes. The workflows package installs on its own with pip and does not require the full framework.