// the find
LucieEveille/kiwi-mem
🥝 Self-hosted memory gateway for AI companions — OpenAI-compatible proxy with vector search, memory heat, Dream consolidation and calendar-level summaries · AI 伴侣记忆网关:向量搜索、记忆热度、Dream 睡眠整合、日历层级摘要,任何客户端都能接
kiwi-mem is a self-hosted gateway that sits between a chat client and an LLM provider, accepting both OpenAI-format and Anthropic-native requests and injecting and extracting long-term memory on each turn. It is aimed at people running a persistent companion, roleplay character, or personal assistant on their own server who want to see and export what the model remembers. It is not a document RAG tool.
The memory model goes beyond store-and-search. Heat decays over time, rises when a memory actually lands in a prompt, and decides whether a memory is injected in full, as a summary, or not at all. Injection order puts static content (persona, profile, locked memories, calendar summaries) ahead of dynamic search results, which is the right way to set up provider prompt caching. The Anthropic-native adapter is a real differentiator, since most memory proxies only speak OpenAI format. The update script backs up the database before pulling, applies schema changes on startup, and rolls back if the new container fails to respond, which is more care around upgrades than most small self-hosted projects take.
Authentication is off by default. The README says so plainly, but it means the admin panel, the /sync/export endpoint (which can include provider API keys), and /sync/import-backup are open to anyone who finds the URL. You need Cloudflare Access or a reverse proxy in front before exposing it. The up-to-90% input cost saving and the roughly 0.01 to 0.03 yuan per Dream run are stated without benchmarks or method, so treat them as the author's estimates. The configuration surface is large (80+ runtime parameters, a 20-plus tool drawer, several heat and decay knobs), and the defaults for decay, softening, and lock retirement interact in ways the README does not fully explain, so tuning is trial and error. The primary README and docs are in Chinese, with English as a secondary translation, which makes the project harder to adopt for non-Chinese readers. Development looks driven by one person at 327 stars, so expect slow turnaround on issues.