How to build session memory
Key point
Combined LLM Wiki with MemPalace MCP to implement cross-session memory for Claude Code.
Details
Memoriki is a template that combines a Karpathy-style LLM Wiki with MemPalace MCP so that Claude Code can carry context forward even when sessions change.
In the LLM Wiki layer, when you put raw materials like articles, transcripts, and notes into a folder, Claude Code creates wiki pages based on them. Entities, concepts, sources, and syntheses are organized via wiki-links and YAML frontmatter, and once knowledge is compiled, it isn't re-inferred again for each subsequent query.
The MemPalace MCP layer adds executable memory on top of this.
- Semantic search: Performs meaning-based search using embeddings, handling 856 text chunks as an example.
- Knowledge Graph: Links entities and relationships along with type/timestamp, immediately returning structured answers to questions like which tools were used.
- Agent Diary: Notes left by the AI in one session are read in the next session.
The author compared the same question across three approaches.
- Grep (wiki only): Finds files containing the word, but required manually opening and combining multiple files.
- MemPalace search (no wiki): Finds semantically close fragments, but the structure was weak since it centered on raw text fragments.
- KG query (using both): Got a structured answer including relationships and dates in a single call.
The setup is described as very simple.
git clone https://github.com/AyanbekDos/memoriki.git
pip install mempalace && mempalace init .
claude mcp add mempalace -- python -m mempalace.mcp_server
It states that you can use it right away in Claude Code, and in Codex, you just need to rename CLAUDE.md to AGENTS.md. The entire project is under the MIT License, and a link to the GitHub repository is also provided.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.