INTEGRITY Cloudflare Docs

How Agent Memory works

Agent Memory is a managed service that gives your applications persistent, AI-powered memory. It automatically turns raw conversations into structured knowledge and retrieves the right context when you need it.

Memory types

Agent Memory classifies every extracted memory into one of four types:

How ingestion works

When you call ingest(), Agent Memory processes the conversation through several stages:

  1. Extraction — AI reads the conversation and identifies discrete, memorable items. Each item is a standalone piece of knowledge with a clear summary and supporting content.

  2. Classification — Each extracted item is classified into a memory type (fact, event, instruction, or task) and assigned a topic key, keywords, and search queries for later retrieval.

  3. Deduplication — The system checks for duplicates against both the current batch and existing stored memories. Facts and instructions with the same topic key supersede older versions rather than creating duplicates.

  4. Storage — Memories are written to durable storage with full-text search indexes. Non-task memories are also embedded as vectors for semantic search.

Raw conversation messages are always stored verbatim alongside extracted memories, preserving the original transcript for full-text search.

How recall works

When you call recall(), Agent Memory runs multiple retrieval strategies in parallel:

  1. Query analysis — AI analyzes your query to determine the best retrieval approach, generating keyword terms, topic keys, and semantic search vectors.

  2. Parallel retrieval — The system simultaneously searches across keyword indexes, topic key lookups, semantic vector indexes, and raw conversation messages.

  3. Scoring and ranking — Results from all sources are combined and ranked to surface the most relevant memories while maintaining diversity across retrieval methods.

  4. Synthesis — AI generates a natural language answer from the top-ranked memories, grounded in the actual stored content.

If no memories match the query, recall() returns an empty answer rather than hallucinating a response.

Idempotency and deduplication

Agent Memory is designed for safe re-ingestion:

Profiles and namespaces

Understand the isolation model for memory storage.

Workers API

Configure bindings and use profiles from Worker code.