| 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 |
有关贡献和扩展 Memory.sh 代码库的开发人员指南。在以下情况下使用:(1) 了解 Memory.sh 架构以及包的连接方式,(2) 添加新的 CLI 命令或 MCP 工具,(3) 修改内存存储层 (SQLite/libSQL),(4) 在 Web 仪表板 (Next.js/Supabase) 上工作,(5) 为 AI 工具添加新一代目标,(6) 扩展云同步或嵌入功能,(7) 调试 monorepo 中的构建、测试或部署问题。 来源:webrenew/memories。