Home / Blog / Meta Long Memory Search Modeling: How Meta Is Scaling…
Engineering

Meta Long Memory Search Modeling: How Meta Is Scaling Extended History

LastN filtered noise but discarded relevant history, including seasonal shopping patterns and recurring interests that do not appear in a recent window.

By Dillip Chowdary • Dec 05, 2026 • Source: Meta Engineering

Meta Long Memory Search Modeling: How Meta Is Scaling Extended History
Image: Meta Engineering

Meta published its Long Memory Search Modeling system on December 4, 2026, describing how the company adapted retrieval-augmented generation techniques from large language models to extend the user history that its ads ranking models can draw on. According to Meta Engineering's report, the system has been in production since 2025 and has delivered a 1 percent lift in click-through rate on Facebook Feed and Reels and a 1.2 percent lift in conversion rate, while reducing compute requirements by five to ten times compared with linear history scaling.

This article covers how Meta treats engagement history as a retrieval corpus, how the RAG-inspired pipeline works, the infrastructure choices that keep latency within production budgets, and what the system means for advertisers who depend on matching signals across long user consideration cycles.

01LastN replaced by retrieval from an indexed engagement corpus

The previous default for ads history was LastN, which kept only the last N events or days for a person and applied the same cutoff to everyone. LastN filtered noise but discarded relevant history, including seasonal shopping patterns and recurring interests that do not appear in a recent window. Scaling beyond LastN posed three problems: identifying which interactions were relevant, handling the linear-to-quadratic storage and processing cost of full histories, and preventing models from forgetting older patterns when retrained on rolling windows of recent data.

Meta Long Memory Search Modeling treats the history scaling problem as a retrieval task. Each person's eligible engagement history is organized into an indexed set of units, similar to document chunks in text-based RAG, and each ad request acts as a query. A retrieval model selects a compact, non-redundant subset of history to pass to the ranking model, letting the system draw on long-term signals while staying within the tight latency budgets of real-time ranking.

02Four-part RAG pipeline adapted for ad requests

The system mirrors the four components of a standard RAG pipeline. The query encodes signals such as recency, user cohort, ad category, and interest topics; it can emphasize topical relevance or recency depending on what the ad request requires. The index organizes a person's history into chunked units across time and topic, each summarizing engagement from one data source over a defined period.

Retrieval scores index entries against the query, turning sparse event data into a compact set of relevant signals. Augmentation passes the retrieved entries to the ranking model as embeddings, as training examples, or as events for user sequence models and GEM, Meta's ads foundation model trained at LLM scale.

03Maximal Marginal Relevance to balance recency and older signals

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

Retrieval quality depends on more than matching the strongest items. Recent behavior tends to repeat, so the highest-scoring candidates are often near-copies of the same recent interest; they add little new information and can displace older signals. Meta Long Memory Search Modeling applies Maximal Marginal Relevance to score each candidate both on relevance to the current request and on how different it is from items already selected.

A candidate that closely duplicates an item already in the retrieved set is penalized even if it is relevant on its own. The result is a retrieved set that can include a recent interest, a recurring one, and a longer consideration cycle together, giving advertisers broader intent coverage from a single request.

04Time-chunking, compact vectors, and async indexing for latency control

Meta's ads ranking systems process large numbers of candidate ads for each request inside a tight latency budget. All preprocessing, including Long Memory Search and summarization, must fit inside that budget. Four design choices keep the system within those constraints.

Consecutive days of history are grouped into weekly units, reducing the amount that must be stored and searched. Learned representations are quantized into compact numeric formats to cut memory and bandwidth.

Retrieval runs over a vector index using nearest-neighbor search rather than scanning the full history. Indexing and other preparation work run asynchronously before a request arrives, keeping that computation off the latency-critical path.

05Embedding retrieval and training replay share a common pipeline

The system supports two production applications that share the same pipeline. At inference time, historical embeddings are retrieved and passed as additional features to ranking models, allowing a recurring interest to inform a decision months later. At training time, older examples are retrieved and replayed in a second training pass to counter catastrophic forgetting: ranking models can then learn when longer-horizon signals matter without losing that knowledge when retrained on recent data.

The two applications reinforce each other. Training replay teaches models when long-horizon signals should matter; online retrieval then makes those signals available during each ranking request. Because both share infrastructure, improvements made for one benefit the other without duplicating engineering effort.

FACTS System: Meta Long Memory Search Modeling Production since: 2025 CTR lift (Facebook Feed, Reels): +1% CVR lift: +1.2% Compute efficiency vs. linear scaling: 5–10× better Previous approach: LastN (last N events or days)

Frequently asked questions

What is Meta Long Memory Search Modeling?

It is Meta's system for extending the user engagement history that ads recommendation models can draw on. It adapts retrieval-augmented generation techniques, treating a person's history as a document corpus and each ad request as a query to retrieve relevant past signals.

What lift did the system deliver in production?

Meta reported a 1 percent lift in click-through rate on Facebook Feed and Reels and a 1.2 percent lift in conversion rate, while delivering five to ten times better compute efficiency than linearly scaling history length.

Why did Meta not simply increase history length linearly?

Linear history scaling is costly because storage, serving, and processing grow linearly to quadratically with history length, which real-time ranking budgets cannot absorb. The RAG-based approach retrieves a compact, relevant subset instead of processing the full history each time.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →