Shared Go module: pgvector + sqlite memory backends with MCP server for Lab Director
This repository has been archived on 2026-05-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
Aaron Reynoza 1797228541 feat(mcp): MCP stdio server wrapping memory.Store
Defines six tools (memory_remember, _recall, _wakeup, _relate,
_relations, _forget) with JSON schemas. JSON-RPC line-delimited stdio.
Backend-agnostic — any memory.Store implementation works.

Tests verify initialize/tools/list/tools/call lifecycle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 00:26:43 -06:00
embedding feat: Embedder interface, OllamaEmbedder, NullEmbedder fallback 2026-04-29 00:20:19 -06:00
mcp feat(mcp): MCP stdio server wrapping memory.Store 2026-04-29 00:26:43 -06:00
sqlite feat(sqlite): SQLite + sqlite-vec backend 2026-04-29 00:25:32 -06:00
.gitignore init: lab-director-memory module scaffold 2026-04-29 00:19:20 -06:00
go.mod feat(sqlite): SQLite + sqlite-vec backend 2026-04-29 00:25:32 -06:00
go.sum feat(sqlite): SQLite + sqlite-vec backend 2026-04-29 00:25:32 -06:00
LICENSE init: lab-director-memory module scaffold 2026-04-29 00:19:20 -06:00
README.md init: lab-director-memory module scaffold 2026-04-29 00:19:20 -06:00
store.go feat: shared Store interface, types, and tokencount 2026-04-29 00:19:49 -06:00
tokencount.go feat: shared Store interface, types, and tokencount 2026-04-29 00:19:49 -06:00

lab-director-memory

Shared memory store for Lab Director and the lab-director-plugin Claude Code plugin.

What it is

A Go module that exposes a Store interface for structured, vector-indexed memory. Two interchangeable backends:

  • pgvector — PostgreSQL + pgvector. Used by Lab Director's backend for cluster-canonical memory.
  • sqlite — SQLite + sqlite-vec. Used by the plugin's bundled MCP server for local memory.

Both backends share the same wire protocol (an MCP server that speaks the same tools). Sync between them happens via Lab Director's existing REST API.

API surface

type Store interface {
    Remember(ctx, RememberInput) (*Entry, error)
    Recall(ctx, RecallInput) ([]RecallResult, error)
    WakeUp(ctx, scope) (*WakeUpContext, error)
    Relate(ctx, RelateInput) (*Relation, error)
    Relations(ctx, entryID) ([]Relation, error)
    Forget(ctx, id) error
}

type Embedder interface {
    Embed(ctx, text) ([]float32, error)
}

Construct via:

import "forgejo.aaron.reynoza.org/aaron/lab-director-memory/pgvector"
import "forgejo.aaron.reynoza.org/aaron/lab-director-memory/sqlite"
import "forgejo.aaron.reynoza.org/aaron/lab-director-memory/embedding"

emb := embedding.NewOllamaEmbedder("http://localhost:11434", "nomic-embed-text")
pgStore := pgvector.NewStore(pool, emb)
sqStore, _ := sqlite.NewStore("/path/to/memory.db", emb)

MCP server

go run ./cmd/memory-mcp -backend=sqlite -db=/path/to/memory.db
go run ./cmd/memory-mcp -backend=pgvector -dsn=postgres://...

Stdio JSON-RPC. Tools: memory_remember, memory_recall, memory_wakeup, memory_relate, memory_relations, memory_forget.

License

MIT.