Session
Active working context for the current task.
Stored: Session events, checkpoints, boundary snapshots.
Recall: Used first for continuity in ongoing work.
Segment agent memory by lifecycle: session context, semantic truths, episodic logs, and procedural workflows. Recall what matters and generate native configs for every tool.
pnpm add -g @memories.sh/cliThis is the core model behind memories.sh. Session, semantic, episodic, and procedural memory are stored separately so agents keep continuity without blending durable truths with transient chat history.
Active working context for the current task.
Stored: Session events, checkpoints, boundary snapshots.
Recall: Used first for continuity in ongoing work.
Durable truths and stable project knowledge.
Stored: Rules, facts, decisions, `memory.md` in OpenClaw mode.
Recall: Always-on grounding for consistent behavior.
Timeline fidelity for what happened and when.
Stored: Daily logs + raw session snapshots.
Recall: Chronology and context history on demand.
Repeatable workflow memory and runbooks.
Stored: Skill-like workflows and promotion signals.
Recall: Prioritized when intent matches a workflow.
Count Trigger
Near token/turn budget boundaries
Time Trigger
Session inactivity compaction windows
Event Trigger
Reset, handoff, or task-complete boundaries
Lifecycle-aware memory for real agent work: session continuity, compaction safety, and long-term retrieval that stays coherent.
Separate session working context from long-term semantic, episodic, and procedural memory so agents stop mixing timelines with durable truths.
Write checkpoints and snapshots before context boundaries so important state survives reset, inactivity, and token pressure.
Recall merges always-on rules with relevant session and long-term memories, so answers stay consistent across long tasks.
Generate native configs for Cursor, Claude Code, Copilot, Windsurf, Cline, Roo, Gemini, and more.
Run bootstrap, flush, and snapshot against memory.md, daily logs, and raw snapshots for git-friendly lifecycle continuity.
Export everything to JSON or YAML anytime. Switch tools or leave entirely. Your data is yours.
The SDK connects your AI apps to memories.sh cloud—giving every prompt the right rules and context. memoriesMiddleware() is all it takes.
Start in Dashboard → AI SDK Projects to create your API key and project isolation (`tenantId`). Then add middleware and ship. The CLI and MCP handle local-first storage and agent access, while the SDK handles your app runtime.
Read the SDK docsOne memory store, every coding agent. Generate native config files for each tool so your context follows you—no copy-paste, no manual sync.
Generates CLAUDE.md, path-scoped rules, skills, and settings.
View Docs →Generates .cursor/rules/ with globs frontmatter and skills.
View Docs →Vercel's AI frontend builder. Connects to memories.sh through MCP for live context.
View Docs →Generates .github/copilot-instructions.md.
View Docs →Generates .windsurf/rules/memories.md.
View Docs →Generates GEMINI.md for Google's coding agent.
View Docs →Generates .clinerules for the Cline VS Code extension.
View Docs →Generates .roo/rules/ for the Roo Code agent.
View Docs →Generates AGENTS.md for the OpenCode terminal agent.
View Docs →Connects to memories.sh through MCP for live context and memory writes.
View Docs →Generates AGENTS.md for the OpenAI Codex CLI agent.
View Docs →Generates .amp/rules/ for the Amp coding agent.
View Docs →Generates config for the Kilo coding assistant.
View Docs →Generates rules for the Trae coding agent.
View Docs →Generates .goose/rules/ for the Goose agent by Block.
View Docs →Open-source personal AI assistant with persistent memory and skill plugins.
View Docs →Google's agent-first IDE powered by Gemini.
View Docs →AWS's agentic AI IDE with CLI and autonomous agents.
View Docs →Factory AI's terminal coding agent for end-to-end dev workflows.
View Docs →9 tools at full CLI parity with FTS5 search. For bolt.new, Lovable, and any MCP client.
View Docs →Capture session checkpoints, recall layered context, and generate native configs for every agent tool from one CLI.
Active working context with checkpoints and boundary snapshots.
Semantic truths plus episodic daily logs and raw snapshots.
Reusable workflows recalled when task intent matches.
pnpm add -g @memories.sh/cliSession lifecycle + long-term semantic, episodic, and procedural memory in local SQLite.
Learn moreOne predictable SDK surface for retrieval, writes, graph rollout, and diagnostics. Designed for strict clients and fast incident debugging. `tenantId` is the database boundary, `userId` is end-user scope, and `projectId` is an optional repo context filter. Default SDK transport is HTTP API; MCP transport is optional.
/api/sdk/v1/context/getPull rules + memories with scoped routing and graph-aware retrieval strategy controls.
Request
{ "query": "how do we ship rollout safely?", "strategy": "hybrid_graph", "graphDepth": 1, "scope": { "tenantId": "webrenew-prod", "userId": "charles@webrenew.io", "projectId": "github.com/webrenew/memories" }}Response
{ "ok": true, "data": { "rules": [...], "memories": [...], "trace": { "strategy": "hybrid_graph", "rolloutMode": "canary" } }, "error": null, "meta": { "endpoint": "/api/sdk/v1/context/get" }}Single Envelope
ok / data / error / meta on every SDK endpoint.
Request Tracing
Every response includes meta.requestId for support and logs.
Typed Errors
Stable error.type and error.code for deterministic client handling.
Versioned Surface
Breaking changes move to /api/sdk/v2/*, not v1 drift.
Start free, upgrade when you need cloud sync, and scale to team billing with metered AI SDK project routing.
Durable state on your machine. No account required.
Hosted memory for solo builders shipping with cloud sync and dashboard access.
Per-seat collaboration plan for organizations that need shared workspaces.
For production AI SDK apps with metered project routing and overage pricing.
@memories.sh/ai-sdk packagememoriesMiddleware() for AI SDKCommon questions about memories.sh and how it works.