| db.ts | SQLite via libSQL. Schema migrations, FTS5 triggers, getDb() singleton | | memory.ts | All memory operations: add, search, list, forget, update, getContext, getRules, streaming | | embeddings.ts | Local embeddings via Xenova/Transformers. generateEmbedding(), cosine similarity | | git.ts | getProjectId() — derives project ID from git remote URL |
| auth.ts | Cloud auth token storage, device code flow helpers | | turso.ts | Turso embedded replica sync (cloud ↔ local) | | config.ts | YAML config read/write (/.config/memories/) | | setup.ts | Tool detection (Cursor, Claude, Windsurf, VS Code), MCP config setup | | templates.ts | Built-in memory templates (decision, error-fix, api-endpoint, etc.) |
| ui.ts | Terminal styling: chalk, figlet, gradient, boxen |
Developer guide for contributing to and extending the memories.sh codebase. Use when: (1) Understanding the memories.sh architecture and how packages connect, (2) Adding new CLI commands or MCP tools, (3) Modifying the memory storage layer (SQLite/libSQL), (4) Working on the web dashboard (Next.js/Supabase), (5) Adding new generation targets for AI tools, (6) Extending cloud sync or embeddings functionality, (7) Debugging build, test, or deployment issues in the monorepo. Source: webrenew/memories.