MadWeightsOpen weights research. The Raw Uncut.
TUTORIAL ·

Give a local agent long-term memory with self-hosted Honcho and a GPU embeddings server

At the end of this guide your local agent will remember things across conversations. Honcho, an open-source memory server from Plastic Labs, stores what is said, works out facts about the people involved in the background, and hands a short block of context back to the agent on each turn. You will run it yourself, point it at the model server you already have, give it a small GPU embeddings server built from llama.cpp, and connect Hermes Agent from Nous Research to it. This is for readers who already run a local OpenAI-compatible model server and want an agent that does not start from zero every session.

Requirements: one NVIDIA GPU with about 1 GB free for embeddings · Linux · Docker with Compose, or Python with uv · Postgres with pgvector · current Honcho (v3 docs) · a CUDA build of upstream llama.cpp · Hermes Agent with its memory plugin · a local OpenAI-compatible chat server with tool calling

Requirements

  • A local OpenAI-compatible chat server whose model handles OpenAI-format tool calling.
  • Docker with the Compose plugin, or Python with uv, on the machine that will run Honcho.
  • Postgres with the pgvector extension (the Compose setup provides it).
  • One GPU with about a gigabyte free for a small embeddings model, and a CUDA build of upstream llama.cpp.
  • A small embeddings model in GGUF format, such as EmbeddingGemma-300M at Q8_0.
  • Hermes Agent installed.

What Honcho keeps

  • Peers are the participants: you, and the agent. Memory is held per peer, across sessions.
  • Sessions are conversation threads. Messages belong to a session and to the peer who sent them.
  • Conclusions are short facts a background worker draws from messages, such as a stated preference. They are stored with embeddings so they can be searched by meaning.
  • Summaries are a short and a long running summary of each session, rewritten every so many messages.
  • Peer cards are a small list of stable facts about a peer, kept up to date by an optional consolidation pass the docs call dreaming.

The API server only stores and enqueues. A separate worker, the deriver, makes the model calls later. That is why memory lags a little behind the conversation, and why the worker is where load on your model comes from.

Steps

1. Run the embeddings server on one GPU

Honcho turns every message and conclusion into a vector. A small model on a GPU does this quickly and keeps the work off your main model. Start llama.cpp's server in embeddings mode with mean pooling and one slot, on a GPU of your choice:

CUDA_VISIBLE_DEVICES=1 llama-server -m <models-dir>/embeddinggemma-300M-Q8_0.gguf \
  --embeddings --pooling mean -ngl 99 \
  -c 2048 -b 2048 -ub 2048 --parallel 1 \
  --alias embeddinggemma-300m --host <server-address> --port 8081

Change CUDA_VISIBLE_DEVICES to the card you want to use. Keep -b and -ub at least as large as the longest input you will send, because an embedding input is processed in one batch. The flags are in the llama.cpp server documentation; Honcho calls the OpenAI-compatible /v1/embeddings endpoint. Use an upstream llama.cpp build for this server rather than a modified fork.

2. Start Postgres, the API server and the worker

Follow the self-hosting guide. With Docker, clone the repository from GitHub, then:

cp .env.template .env
cp docker-compose.yml.example docker-compose.yml
docker compose up -d --build

That starts the API, the deriver, Postgres and Redis. Without Docker, the documented manual path is:

uv sync
source .venv/bin/activate
cp .env.template .env
uv run alembic upgrade head
uv run fastapi dev src/main.py

Then, in a second terminal, start the deriver:

uv run python -m src.deriver

Without the deriver, messages are stored but nothing is learned. The database needs the vector extension; pg_trgm and btree_gin are optional and only add indexes.

3. Point Honcho's model settings at your local server

Honcho reads settings from environment variables named SECTION_KEY, with __ for nesting, as the configuration guide explains. Each background task has its own model settings. Put these in .env, with <model-url> replaced by your chat server's address, such as http://<server-address>:8080/v1:

DERIVER_MODEL_CONFIG__TRANSPORT=openai
DERIVER_MODEL_CONFIG__MODEL=<your-model-name>
DERIVER_MODEL_CONFIG__OVERRIDES__BASE_URL=<model-url>
DERIVER_MODEL_CONFIG__STRUCTURED_OUTPUT_MODE=json_object
SUMMARY_MODEL_CONFIG__TRANSPORT=openai
SUMMARY_MODEL_CONFIG__MODEL=<your-model-name>
SUMMARY_MODEL_CONFIG__OVERRIDES__BASE_URL=<model-url>

Also set LLM_OPENAI_API_KEY in .env to the key your model server expects. Set the same three model keys for each dialectic level you use (DIALECTIC_LEVELS__low__MODEL_CONFIG__... and so on) and for the dream specialists (DREAM_DEDUCTION_MODEL_CONFIG__... and DREAM_INDUCTION_MODEL_CONFIG__...). The json_object line matters for most local servers, which do not enforce json_schema output. If Honcho runs in Docker, use an address the container can reach, not the container's own loopback.

4. Point Honcho at the embeddings server

Replace <embed-url> with the embeddings server's address, such as http://<server-address>:8081/v1.

EMBEDDING_MODEL_CONFIG__TRANSPORT=openai
EMBEDDING_MODEL_CONFIG__MODEL=embeddinggemma-300m
EMBEDDING_MODEL_CONFIG__OVERRIDES__BASE_URL=<embed-url>
EMBEDDING_MODEL_CONFIG__DIMENSIONS_MODE=never
EMBEDDING_MODEL_CONFIG__ENCODING_FORMAT_MODE=float
EMBEDDING_VECTOR_DIMENSIONS=768
EMBEDDING_MAX_INPUT_TOKENS=1024

Set EMBEDDING_VECTOR_DIMENSIONS to your model's output size (768 for EmbeddingGemma-300M; the default of 1536 suits OpenAI's models). It is fixed for the life of a deployment, so set it before the first message; to change it later, follow changing embeddings. DIMENSIONS_MODE=never stops Honcho asking the server for a vector size it cannot produce. Keep EMBEDDING_MAX_INPUT_TOKENS well below the model's context, because Honcho counts tokens with a different tokeniser from the model's.

5. Connect Hermes Agent

Hermes Agent ships Honcho support as a memory provider plugin. Follow the Hermes Agent integration page: install the plugin with the agent's plugins command, run the agent's memory setup command for Honcho, choose the self-hosted option and enter your Honcho address (http://<server-address>:8000). The setup writes a JSON config with baseUrl, a workspace, your peerName and the agent's aiPeer.

Check it worked

  • Ask the API for its health with curl http://<server-address>:8000/health. The self-hosting guide shows the response {"status":"ok"}. It only proves the process is up, not that the database or models are reachable.
  • Run the agent's Honcho status command, described on the integration page. It should show Honcho enabled, your workspace and peer names, and a connection that is OK.
  • Send the agent a message that states a clear preference. After a minute or two, list the conclusions for your peer through the API or the agent's memory tools; one should reflect what you said.
  • Start a new session and ask something that depends on the earlier fact. The injected context should bring it back.

Common problems

  • The model server is flooded by background requests and waits grow to minutes: limit how many Honcho requests reach it at once, with a small queueing proxy in front of the server, or give Honcho its own small model.
  • The queue drains but no conclusions appear: the server does not enforce json_schema output. Set DERIVER_MODEL_CONFIG__STRUCTURED_OUTPUT_MODE=json_object, as the troubleshooting page says.
  • A dialectic call returns 422: set STRUCTURED_OUTPUT_MODE=json_object on that level's model config.
  • Memory stops updating while messages still arrive: the deriver is not running, cannot reach the database, or has no provider key. Check its logs first.
  • Honcho in Docker cannot reach your model server: the address points at the container itself. Use the host's network address, and test it against the server's /v1/models endpoint.
  • Search results look wrong after switching embeddings builds: compare a few vectors from the GPU server against a CPU build of upstream llama.cpp before you trust it.

Keep the load on one local model under control

  • Leave DERIVER_WORKERS at its default of one.
  • Turn off observation of the agent's own peer by setting observe_me to false in its peer configuration. The design patterns page treats deriving from the assistant's messages as a common mistake.
  • Summarise less often by raising SUMMARY_MESSAGES_PER_SHORT_SUMMARY and SUMMARY_MESSAGES_PER_LONG_SUMMARY (defaults 20 and 60), or per workspace with the summary settings on the reasoning configuration page.
  • Store injected text, such as pinned notes or tool output, with a message reasoning setting of enabled: false, so it is kept but not reasoned over.
  • In the agent's config, keep dialecticReasoningLevel at low and consider recallMode set to context, which injects context without exposing extra tools.

Our recommendation

On one local model we'd switch on the deriver and summaries first, with observation of the user only. That gives searchable facts and session summaries, which is most of the value. We'd leave dreaming off at first (dream.enabled false), because each dream is a long chain of model calls on the same server. We'd keep Hermes Agent's recall on context injection with a low reasoning level, so a normal turn costs little extra generation. We'd put embeddings on their own small GPU server, because it is cheap in memory and keeps vector work out of the main model's queue. And we'd cap concurrent Honcho requests before raising anything else. On our own server, one of three V100 cards carries the embeddings model beside its main work.

Further reading