Memory

SkillDocs & knowledge

Persistent cross-session memory management. Store and retrieve user preferences, project decisions, code patterns, and conversation summaries across sessions. Use when you need to remember something important or recall past context.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Memory skill

What this skill tells your AI

The instructions your AI receives, as published by neuron-mr-white/unipi in packages/memory/skills/memory/SKILL.md and read by ahel’s review.

Persistent cross-session memory for Pi coding agent. Memories survive session restarts, compaction, and context resets.

When to Store Memory

Store memory when you encounter:

TypeExamplesTitle Format
PreferenceUser likes tabs, prefers functional stylestyle_typescript_prefer_tabs
DecisionChose PostgreSQL over MySQL, JWT over sessionsdb_postgres_chosen_over_mysql
PatternHow auth is structured, API naming conventionsapi_rest_versioning_v2
SummaryKey findings from debugging, research resultsperf_slow_query_root_cause

Naming Convention

Format: <most_important>_<less_important>_<lesser>

Rules:

  • Use underscores, not hyphens
  • Start with category (style, db, auth, api, arch, etc.)
  • Be specific: auth_jwt_prefer_refresh_tokens not auth_tokens
  • Keep under 60 characters

Good titles:

  • style_typescript_strict_mode_always
  • db_postgres_use_connection_pooling
  • arch_api_versioning_v2_breaking
  • perf_cache_redis_for_sessions

Bad titles:

  • auth (too vague)
  • User prefers tabs (not snake_case)
  • auth-jwt-refresh (hyphens, not underscores)

When to Search Memory

Search memory when:

  1. User references past work: "Remember when we fixed the auth bug?"
  2. Making similar decisions: "What did we decide about database choice?"
  3. Setting up new features: "What's the user's coding style?"
  4. Debugging recurring issues: "Have we seen this error before?"

How to Use Tools

Store a memory:

memory_store(
  title: "auth_jwt_prefer_refresh_tokens",
  content: "User prefers short-lived access tokens (15min) with long-lived refresh tokens (30d). Always implement token rotation on refresh.",
  tags: ["auth", "jwt", "preferences"],
  type: "preference"
)

Search memories:

memory_search(query: "auth tokens")

List all project memories:

memory_list()

Delete a memory:

memory_delete(title: "auth_jwt_prefer_refresh_tokens")

Search Scope

memory_search searches ALL projects by default. Use scope param to narrow:

ActionScopeTool
StoreAlways project-scopedmemory_store
Search all projectsCross-project (default)memory_search(query) or memory_search(query, scope="all")
Search this projectCurrent project onlymemory_search(query, scope="project")
List allCross-projectglobal_memory_list

All memories are project-scoped. When you store a memory, it belongs to the current project. memory_search searches everything by default — no need to call a separate global search.

Update-First Principle

Always check before creating. Before storing a new memory:

  1. Search for similar memories
  2. If found and relevant → UPDATE the existing memory
  3. If not found → CREATE new memory

This prevents memory duplication and keeps memory clean.

Vector Search (Embeddings)

Memory supports vector similarity search via OpenRouter API.

Setup

  1. Run /unipi:memory-settings
  2. Add your OpenRouter API key
  3. Select embedding model (default: openai/text-embedding-3-small)

How it works

  • Embeddings are generated when storing/searching memories
  • Search combines vector similarity + fuzzy text matching for best results
  • Vector search finds semantically similar memories even without exact keyword matches

Model compatibility

Different embedding models produce incompatible vectors. If you switch models, existing embeddings won't match new searches. Use /unipi:memory-settings → "Re-embed All Memories" to fix.

No API key?

Falls back to fuzzy text-only search. Still works, just less semantic.

When the user runs /unipi:memory-consolidate or during compaction:

  1. Review the session for memory-worthy items
  2. For each item:
    • Search for existing similar memory
    • Update if found, create if not
  3. Report what was stored/updated

Reading Memory Files

Memory files are stored in ~/.unipi/memory/ as markdown with YAML frontmatter:

---
title: auth_jwt_prefer_refresh_tokens
tags: [auth, jwt, preferences]
project: my-app
created: 2026-04-26T10:00:00Z
updated: 2026-04-26T15:30:00Z
type: preference
---

# Auth: Prefer Refresh Tokens

User prefers short-lived access tokens (15min) with long-lived refresh tokens (30d).
Always implement token rotation on refresh.

You can read these files directly with the read tool for full context.

Anti-Patterns

Don'tDo Instead
Store everythingOnly store decisions, preferences, patterns, summaries
Create duplicate memoriesSearch first, update existing
Use vague titlesUse specific <category>_<detail> format
Store in wrong scopeProject-specific = project scope, universal = global
Forget to updateWhen context changes, update the memory
Switch embedding models without re-embeddingRe-embed or accept fuzzy-only fallback

Signals

GitHub stars
64
Forks
15
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
memory-neuron-mr-white
Source
github.com/neuron-mr-white/unipi