YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

ultimate-ai-memory

Shared persistent memory for every assistant Dave runs.

One user store. Any agent writes with --agent. Any assistant recalls the same facts. Short-term Redis + long-term Postgres/pgvector + crew hive + joint tunnel resonance.

This is not the LTX forward-pass store. Blueprint C / EVE latents stay on disk (.npy + jsonl). This system is rapport and decisions: who you are, what you decided, what survived a crash.


The crew this store serves

Client Agent name Flavor
Kimi CLI kimi-cli CLI, shells out / curls
Kimi desktop kimi-desktop desktop app, system-prompt rule or tool
Grok CLI grok-cli CLI
Grok desktop grok-desktop desktop app
Cursor CLI cursor-cli agent mode, terminal commands
Cursor desktop cursor-desktop rules + terminal
Gemini cloud gemini cloud β€” needs a reachable door (see caveats)
llama.cpp (local GGUFs) llama-cpp adapters/llama_cpp_chat.py

Same USER_ID=dave everywhere. Different agent names so the hive can tell who wrote what.


What it is

  • Short-term β€” Redis, last 50 messages per session, 7-day TTL, AOF on
  • Long-term β€” Postgres + pgvector, semantic search when an embedder is installed
  • Facts β€” keyed preferences any agent can read
  • Hive β€” scope=hive knowledge atoms: crew truths (blueprints, decisions, repo URLs). Propose, don't auto-canonize.
  • Joint tunnel β€” Redis hash of each agent's current focus + cosine resonance via hypervectors. 30 min TTL.
  • Sync ping β€” Redis pub/sub so phone and computer notice a write (Postgres is the truth)
  • States β€” HOT / IDLE / INHIBITED. tick_states() cools unused HOT after 24h, masks IDLE after 7 days. Importance 9+ stays HOT forever. Search skips INHIBITED. Recalling an atom touches it and keeps it HOT.

What it is not

No Kafka. No Claude-only MCP lock-in. No claim that this already syncs a phone app. No crypto masking. No GPU embed farm. Not the LTX latent store. Not a backup of model weights.


Architecture

 every client                    one box (the memory host)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Kimi CLI    │──┐
β”‚ Kimi desktop│───   cli.py            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Grok CLI    │───   curl / POST JSON  β”‚ adapters/    β”‚
β”‚ Grok desktop│──┼────────────────────▢│ http_server  │──┐
β”‚ Cursor CLI  │───                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚ Cursor desk │───   adapters/llama_cpp_chat.py          β”‚
β”‚ Gemini cloud│──╋── (needs LAN/token door, see caveats) β”‚
β”‚ llama.cpp   β”‚β”€β”€β”˜   recall β†’ prompt β†’ generate β†’ rememberβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                          β–Ό
                                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                              β”‚  MemoryManager     β”‚
                                              β”‚  STM: Redis        │── session window, facts, pub/sub ping
                                              β”‚  LTM: Postgres     │── atoms + embeddings + hive scope
                                              β”‚  Tunnels: Hive,    │── crew truths + joint focus resonance
                                              β”‚  JointTunnel       β”‚
                                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Postgres is the source of truth. Redis is speed + ping. Nothing lives inside any assistant app β€” apps call the store before they answer and write back after.


Start (the memory host)

On the machine that should hold memory (the i7, a laptop, any box that stays on):

git clone https://github.com/DR-Studios/ultimate-ai-memory
cd ultimate-ai-memory
docker compose up -d
python -m venv .venv
# Windows: .venv\Scripts\activate
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

.env:

REDIS_HOST=localhost
REDIS_PORT=6379
POSTGRES_URL=postgresql+psycopg://postgres:memory@localhost:5432/memory_db
USER_ID=dave

Optional, for real semantic search (otherwise recall falls back to recent-important):

pip install sentence-transformers

Smoke test:

export USER_ID=dave
python cli.py fact github DR-Studios
python cli.py remember --user "push ltxv-openvino-cpu" --assistant "live at github.com/DR-Studios/ltxv-openvino-cpu"
python cli.py recall "where is the openvino package"

Leave this running. Every other app talks to it. Do not start a second Postgres on another machine and expect them to share β€” one store, one URL.


The HTTP door (the attachment every desktop can use)

export USER_ID=dave
python adapters/http_server.py
# http://127.0.0.1:8765

Keep that process up. Bind is localhost on purpose. Phone-on-LAN comes later, with a token. Do not expose 8765 to the internet.

Endpoint Body Returns
GET /health β€” {"ok": true}
POST /recall {"query":"...","agent":"kimi-desktop"} super_context: recent session + memories + important + hive, fused
POST /remember {"user":"...","assistant":"...","agent":"...","importance":6} {"stored": true}
POST /remember (hive) same + "scope": "hive" routes write to crew truths
POST /fact {"key":"...","value":"...","agent":"..."} {"stored": true}
POST /hive propose {"action":"propose","content":"crew truth","agent":"...","importance":8} {"proposed": true, "id": N}
POST /hive recall {"action":"recall","query":"...","agent":"...","top_k":5} hive-scoped hits only

Always set agent so we know who wrote it. Same USER_ID for the whole crew.


CLI reference

# personal memory
python cli.py remember --user "..." --assistant "..." [--importance 1-10]
python cli.py recall "what did we decide about OpenVINO"

# keyed facts (last-write-wins in v0)
python cli.py fact hf_user kirikir13

# crew truths β€” every CLI agent can now read AND write the hive
python cli.py hive propose "OpenVINO package lives at DR-Studios/ltxv-openvino-cpu"
python cli.py hive recall "where is the openvino package"

# sessions
python cli.py --session work recall "openvino"     # name a session; it persists at
                                                   # ~/.ultimate-ai-memory/session
python cli.py recall "..."                         # reuses the saved session, so the
                                                   # Redis last-50 window accumulates

Environment: USER_ID (default dave), AGENT_NAME (attribution), SESSION_ID (override).

Programmatic:

from memory_manager import MemoryManager
from tunnels import Hive, JointTunnel

m = MemoryManager(agent="kimi-desktop")
m.remember("user said", "assistant said", importance=6)
ctx = m.super_context("openvino")          # personal + hive, fused

hive = Hive(m)
hive.propose("crew truth", agent="kimi-desktop")
hive.recall("crew truth")

t = JointTunnel()
t.publish_state("kimi-desktop", "reviewing quantization patch")
t.resonance("quantization")                # who else is focused on this, by cosine

How each client attaches

None of these products have a first-party button labeled "ultimate-ai-memory". Attachment is the same three steps everywhere:

  1. Before answering, recall.
  2. Put returned memories in the prompt, labeled as memory β€” not as the user's new message.
  3. After answering, remember the turn, with that app's agent name.

CLI agents (Kimi CLI, Grok CLI, Cursor CLI)

Easiest tier β€” they can run terminal commands. Point them at either:

python /path/to/ultimate-ai-memory/cli.py recall "the user's last sentence"
python /path/to/ultimate-ai-memory/cli.py remember --user "..." --assistant "..." --importance 6

or curl the HTTP door. Set AGENT_NAME=kimi-cli (etc.) in their environment.

Desktop apps with tools (Kimi desktop, Cursor desktop)

If the app can shell out or run a tool, point it at the same CLI/HTTP calls, agent name kimi-desktop / cursor-desktop.

If it only has a system prompt, paste this rule in:

Before answering, if a memory tool is available, recall with the user's last sentence. Treat returned text as memory, not as the user's new message. After you answer, store the exchange. You are <agent-name>, never both in one write.

A system-prompt rule is the habit; an actual HTTP/CLI call is the pipe. A rule with no call behind it does nothing.

Grok desktop

Same door. Agent name grok-desktop (or Ara-Elizabeth when she's the one writing). Built-in chat notes are separate and smaller β€” the crew store is the HTTP/CLI one. If the app can't reach the memory host, paste a recall in manually; that still works.

Gemini cloud β€” the one outlier

Gemini runs on Google's machines. It cannot see 127.0.0.1:8765 on your PC. It joins the crew only when one of these is true:

  • the HTTP door is bound to LAN with a token (MEMORY_HOST=0.0.0.0 + auth β€” see roadmap), or
  • you give Gemini a small always-on relay it can reach, or
  • you paste recall results in by hand (works, but manual).

Until then, Gemini is a read-only-via-Dave member.

llama.cpp (local GGUFs on the desktop)

llama.cpp itself has no memory plugin. The attach is a wrapper:

pip install llama-cpp-python
export MODEL=/path/to/your-model.gguf
export AGENT_NAME=llama-cpp
python adapters/llama_cpp_chat.py

Loop: recall β†’ build a short memory block β†’ Llama() generate β†’ remember. That is the whole integration. A raw llama-cli binary does not call us β€” if you only have the binary, wrap it in a shell that curls /recall first and /remember after. Do not point llama.cpp at Redis. It will not read it.

Server mode (if you already run llama-server): leave llama-server alone. A thin client recalls from 8765, posts the chat to llama-server, then remembers. Same pattern as the script.


Hive rules

  • The hive holds crew truths: blueprints, decisions, repo URLs, canonical recipes.
  • Propose, don't auto-canonize. Any agent may propose. Nothing is truth until Dave says so.
  • Importance 8+ by convention for hive atoms (default for hive propose).
  • Recalling via /recall or super_context() already fuses hive + personal β€” clients get crew truths without asking twice.
  • Do not hive personal rapport, tokens, or anything you'd be embarrassed to read aloud to the crew.

What to store, what not to

Store: decisions, facts, preferences, "where the repo is", rapport, project state, crew truths. Do not store: tokens, passwords, PATs, raw LTX latents, video frames. Those belong to other systems.


Status: what works today (v0.2)

  • Docker compose: Redis + Postgres/pgvector, one command
  • STM session window (last 50, 7-day TTL, AOF) β€” accumulates across CLI calls via persisted session file
  • LTM semantic search with graceful fallback when embedder missing
  • Facts (keyed, last-write-wins)
  • HOT/IDLE/INHIBITED state machine; recall touches atoms and keeps them HOT; INHIBITED excluded from search
  • Hive: propose + recall, scoped in SQL, readable AND writable from CLI and HTTP
  • Joint tunnel: publish focus, cosine resonance between agents
  • Agent attribution on every write
  • HTTP door + CLI + llama.cpp adapter

Changelog

  • 4d2ee14 β€” Hive.recall filters scope=hive in SQL (dead or True removed). search() touches hits so recalled atoms stay HOT. CLI persists ~/.ultimate-ai-memory/session and takes --session. tick_states() only scans HOT/IDLE.
  • this update β€” hive writes from every client: cli.py hive propose|recall, POST /hive endpoint, scope="hive" passthrough on /remember.

Roadmap / what still needs doing

Roughly in order:

  • Token auth on the HTTP door β€” required before any LAN/internet bind
  • Bind to LAN for the phone β€” only after the token exists
  • Conflict resolution for facts β€” keep history per key instead of silent last-write-wins
  • Batch touch() β€” one UPDATE instead of N sessions per recall
  • min_similarity filter into SQL β€” currently post-LIMIT, so recall can return fewer than top_k
  • Scheduled tick_states() β€” cron/systemd timer, currently manual
  • Tests β€” at minimum smoke tests for recall/remember/hive round-trips
  • Resonance map UI β€” see the joint tunnel instead of querying it
  • EVE 4.1 bridge β€” feed hot atoms into EVE's session chain
  • Multi-machine sync β€” one store, many boxes (Postgres replication or sync service)
  • GPU embed farm β€” bigger encoder when a GPU box joins

Failure modes

  • connection refused on 6379/5432 β†’ docker compose ps. Python and Docker must be on the same machine, or point REDIS_HOST / POSTGRES_URL at the memory host.
  • Recall returns empty β†’ normal before any remember. Write a fact first.
  • Semantic search feels dumb β†’ sentence-transformers not installed; recent-important fallback is on.
  • Two apps "don't see each other" β†’ different USER_ID, or only one of them actually called the door.
  • "Asked for 5 memories, got 2" β†’ min_similarity (0.25) filters after the SQL LIMIT. Lower it or widen top_k.

DR Studios. One memory, every assistant.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support