Nick Stocks

Project · AI memory

Persistent AI Memory

A shared memory layer that carries decisions, discoveries and project context into the next AI session.

Keep the useful context

AI coding sessions produce more than code: architectural decisions, debugging lessons, configuration details and explanations of why something changed. I developed a persistent memory service to make that knowledge searchable across sessions, agents and projects.

A decision saved while working on one project can become useful in another. The service connects related notes through semantic similarity, shared entities and explicit links, so recall does not depend on remembering exactly where a discovery was recorded.

Hybrid recall · simplified architecture
  1. AI coding agentSave a decision or ask for relevant context through MCP
  2. Memory serviceStore notes, extract entities and retrieve related knowledge
  • Semantic similaritypgvector finds related meaning
  • Full-text searchPostgreSQL matches words and phrases
  • Graph proximityFollow authored and automatic links

Notes, chunks, embeddings and relationships live in PostgreSQL. A web canvas exposes the same knowledge graph for browsing and inspection.

One memory, multiple ways to find it

The retrieval layer combines vector similarity, PostgreSQL full-text search and graph proximity. Entity tags connect notes to repositories, pull requests, issues, files and URLs. Query-time tag synonyms help bridge differences in terminology.

Creating or updating a note also creates semantic links to related memories. The web canvas groups notes by project and exposes connections between projects, with access to the full note and its neighbours.

Built for coding workflows

The Model Context Protocol interface lets compatible agents query, read, create and update memories. Code-aware tools provide file overviews, symbol references and definition lookup; Python uses Jedi for semantic resolution, while other languages use text-based fallbacks.

The data model includes an append-only operation log and optimistic-concurrency writes. Those details matter when multiple sessions contribute to the same body of knowledge: changes need a history, and concurrent edits need to be detected.

Origins and attribution

This project began as a fork of AgriciDaniel’s claude-obsidian and was refocused around a PostgreSQL and pgvector MCP service with a browsable web canvas. The agent skills and bootstrap files derive from that upstream project.

The design also draws on Andrej Karpathy’s LLM Wiki pattern and Serena’s approach to code navigation. Jedi provides the Python semantic backend.

Related work

Explore the MCP Hub for shared tool access and MCP Sandboxes for hosted tool execution.