LLMSlim

MCP server and Python library that gives AI agents long-term memory with no LLM call, storing messages word for word in local SQLite or Postgres and recalling what answers a question within a token budget. MIT licensed.

View on GitHub Unknown

A no-LLM-call memory layer for AI agents that stores messages verbatim and recalls only what answers a question within a token budget.

What it is

LLMSlim is an MIT-licensed MCP server and Python library for giving AI agents long-term memory. Messages are stored word for word in a local SQLite file or in Postgres or MongoDB. When an agent asks a question, LLMSlim returns the stored messages that match it, dated and kept whole where they fit, within a token budget the caller sets. Storing and recalling are plain code rather than model calls, so the same history and question produce the same context, which makes recall straightforward to test. The project also includes tools for compressing prompts and fitting long logs or documents into a budget.

Key features

  • Five MCP tools: remember, recall, list_memories, forget and fit_context
  • Verbatim storage in SQLite, Postgres or MongoDB, with no summarization on the way in
  • Token-budgeted recall that returns matching messages with their dates
  • User and agent scope fixed when the server starts, not chosen by the model
  • No LLM or embedding API call by default, so no API key is needed for memory
  • Optional semantic relevance mode via an extra install

Use cases

  • Giving a coding assistant a record of user preferences that persists across sessions
  • Recalling facts a user stated earlier, such as allergies or a recent move, inside an agent
  • Shrinking long logs or documents to a fixed token budget before sending them to a model
  • Testing memory behavior deterministically, since the same inputs return the same context

Who it's for

Developers building AI agents or using MCP-compatible coding tools who want persistent memory without adding an extra model call to every store and recall. It suits teams that prefer local storage and reproducible results.

Getting started

The README's MCP setup uses uv to start the server with the llmslim mcp command, storing memory in a local SQLite file. For Python, install the library with pip and create a Memory object pointing at a database file. Install commands and client-specific setup steps are listed in the README's quick-start section.

Alternatives

The related directory entries include Letta (ex-MemGPT), Cognee, Supermemory, Mem0 and Hindsight, which also address agent memory. This note only lists them as related entries; it does not compare their features.

Drafted with AI from the project's public documentation; verify against the source. Written 1 Nov 2026.

Nearby on the map

Related projects