# llmslim [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/Thanatos9404/llmslim  
**GitHub Stars:** 27  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/llmslim

## Description
Long-term memory for AI agents with no LLM call: an MCP server and Claude Code plugin, plus local-first context compression for LLM apps.

## Tools
Capabilities this server exposes over MCP:

- **remember** — Store a message in long-term memory, word for word.

        Args:
            text: The message to keep, in the speaker's own words.
            role: Who said it: "user" (default) or "assistant".
            session: Optional id of the conversation it belongs to. Messages without one are grouped by day.
        
- **recall** — Find what earlier conversations said about a question: the stored messages that answer it, under their
        dates and whole where they fit (the most relevant parts of longer ones), within a token budget.

        Args:
            query: The question, e.g. the user's latest message.
            budget: Most tokens to return. Defaults to the server's budget.
            session: Optional conversation id to search only that conversation.
        
- **list_memories** — List the most recently stored messages with their ids, newest first.

        Args:
            limit: How many to list, at most 100.
            session: Optional conversation id to list only that conversation.
        
- **forget** — Delete one stored message by its id (from `remember` or `list_memories`). This cannot be undone.

        Args:
            memory_id: The id of the message to delete.
        
- **fit_context** — Shrink a long text (a document, log or tool output) to a token budget, keeping the parts that answer
        the query, in their original order. Text that already fits comes back unchanged.

        Args:
            text: The text to shrink.
            budget: Most tokens to return.
            query: Optional question; the parts that answer it are kept first.
        

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "llmslim": {
    "command": "uvx",
    "args": ["--from","llmslim[mcp]==0.12.0","llmslim","mcp"]
  }
}
```

## Documentation

## What llmslim MCP server does

llmslim provides five MCP tools for retaining and selecting agent context without sending the work through another language model. `remember` writes a user or assistant message to long-term memory exactly as supplied. `recall` searches stored conversations and returns relevant original messages within a token limit. `list_memories` exposes recent entries, while `forget` permanently removes one entry by its identifier.

The fifth tool, `fit_context`, handles context that is not necessarily a conversation. Give it a document, log, or tool result and a maximum token count; it returns a shorter version, keeping relevant sections in their original order. If the input already fits, it is returned unchanged.

## How it works

The MCP process performs storage and retrieval with ordinary database operations and deterministic ranking code. It makes no LLM call, uses no embedding API by default, and requires no model credential. Stored messages remain verbatim rather than being summarized or extracted during ingestion.

A memory can optionally carry a session identifier. Retrieval and listing can then be limited to that conversation; entries without a session are grouped by day. Recall accepts a query and token budget, returning matching material under its dates and including complete messages where they fit. The server fixes user and agent scope when it starts, rather than allowing the model to choose those identifiers during a request.

## Setup and configuration

The MCP command is `llmslim mcp`. With `uv`, a client can launch it using the `llmslim[mcp]` package extra. Python 3.10 or newer is required. The default storage location is the SQLite file `~/.llmslim/memory.db`.

The project also provides a Python library and a small HTTP server. The library can use SQLite, PostgreSQL with the Postgres extra, or MongoDB with the MongoDB extra. TypeScript clients can connect to the HTTP service; its default base URL is `http://127.0.0.1:8080`, and `LLMSLIM_BASE_URL` can override that URL.

Named integrations include Claude Code, Codex, Gemini CLI, VS Code, Cursor, and LM Studio. A Claude Code plugin is also available. The first `uvx` launch downloads the package and dependencies; preloading the command can help clients with short startup timeouts.

## Tools and capabilities

- `remember`: save a message with an optional role and session.
- `recall`: find relevant stored messages for a question within a token budget.
- `list_memories`: list recent memory records, newest first, with a limit of up to 100.
- `forget`: delete a memory by ID; deletion cannot be undone.
- `fit_context`: shorten text to a budget, optionally prioritizing material that answers a query.
- Local SQLite storage by default, with PostgreSQL and MongoDB library backends.
- Optional semantic relevance mode through the `semantic` package extra.

## Limitations and notes

The default lexical search matches words, so differently phrased questions may fail to find semantically equivalent messages. Semantic relevance is optional and downloads a cross-encoder model on its first use. Tokenizer data may also be downloaded once by `tiktoken`.

`forget` is irreversible. Memory scope is established at server startup, so deployments should start separate processes with the intended user and agent scope. The MCP server and HTTP service do not make network calls during normal operation, apart from installation and the tokenizer or optional semantic-model downloads described above.

_Full upstream README: https://allmcps.com/mcp/llmslim/readme_

