RepositoryPython
snap-stanford

snap-stanford/memorilla

🦍 Memorilla: Latent Semantic Memory for LLMs

1.6kstars
101forks
2issues
9views

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: long-context

#1 Repository Của Tuần

1
TINIX TRENDING·Chủ đề: continual-learning

#1 Repository Của Tuần

1
TINIX TRENDING·Chủ đề: context-compression

#1 Repository Của Tuần

🧠 Memorilla: Latent Semantic Memory for LLMs

A memory system that turns any document collection into just 16 query‑dependent tokens for a frozen LLM.

Memorilla is a memory system developed by Snap Stanford that reads an entire document collection—such as a user's past chats, a book, or a set of articles—and compresses it into a fixed number of query‑dependent memory tokens (default 16). These tokens are passed to a frozen LLM, allowing it to answer questions about the collection while using dramatically fewer tokens than the full context. The method is described in the paper Memorilla: Latent Semantic Memory for LLMs and outperforms existing approaches such as Mem0 and MemoRAG.

✨ Highlights

  • Fixed‑size memory: Compresses any document collection into 16 memory tokens, regardless of total length.
  • Query‑dependent: Memory tokens are generated per query, capturing relevant information.
  • Frozen LLM: Works with off‑the‑shelf LLMs (e.g., Qwen3‑8B) without fine‑tuning.
  • State‑of‑the‑art accuracy: Achieves best average performance vs Mem0 and MemoRAG; on FactKG beats using all documents (84.33% vs 80.43%) with 108× fewer tokens.
  • Agent learning: Improves TextWorld game success rate from 18.6% to 24.2%.
  • Efficient scaling: Handles up to 512 documents (≈128K tokens) in 0.74 s on one H100, while full‑context prompting takes 19.9 s.
  • Open source: Apache‑2.0 licensed, with code for training and evaluation.

💡 Why it matters

Memorilla tackles the context‑window bottleneck by learning to extract only the semantic gist needed for each question. Unlike retrieval‑augmented generation that returns large passages, it produces a compact representation that fits into any LLM, dramatically reducing token usage and latency. This makes it viable for long‑term personalization, large document QA, and agent memory without retraining the base model.


#LLM #Memory #ContextCompression #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
mem0ai/mem0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

69.3k
Nov 18, 2026
RepositoryTypeScript
firecrawl/firecrawl

Knowledge infrastructure to make your agents smarter. Search, scrape and access 550+ data providers through one API.

207.6k
Nov 23, 2026
RepositorySvelte
open-webui/open-webui

User-friendly AI Interface (Supports Ollama, OpenAI API, ...)

159.3k
Nov 22, 2026
RepositoryPython
MemPalace/mempalace

The best-benchmarked open-source AI memory system. And it's free.

60.6k
Nov 20, 2026
RepositoryPython
simular-ai/Agent-S

Agent S: the state-of-the-art open source computer use agents

13.0k
Nov 23, 2026
RepositoryPython
plastic-labs/honcho

Memory library for building stateful agents

8.2k
Nov 23, 2026
RepositoryPython
Human-Agent-Society/reef

Infrastructure for continually self‑improving agents

7.6k
Nov 21, 2026
RepositoryPython
NousResearch/hermes-agent

The agent that grows with you

265.6k
Nov 23, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
164.7M
Jun 1, 2026