HomeBlogDocsGitHubStart a Project
Open Source - AGPL-3.0

Persistent Memory for AI Coding Agents

Your AI agent starts every session with amnesia. Sugar remembers your decisions, conventions, and patterns - per project, across projects, locally on your machine.

Your memory. Your machine. Your data.

sugar - zsh
# Store what you know, once...→ Stored as decision [auth-architecture]# ...weeks later, in a fresh session→ sugar recall "authentication"  Auth uses JWT RS256, 15-min expiry - see auth/tokens.py# Your AI agent reads it via MCP, mid-session→ search_memories("how do we handle auth")  No re-explaining. No re-onboarding. Just context.

Your AI coding agent is brilliant - and it forgets everything.

Every new Claude Code, Cursor, or Copilot session starts from zero. The context you built last week is gone.

Session Amnesia

Every new session starts from zero. The architecture decisions, conventions, and gotchas you explained last week are gone. You re-explain them every time.

Endless Re-Onboarding

"We use async/await, never callbacks." "JWT is RS256." "Check __init__.py exports first." You tell your agent the same things, in every repo, in every session.

Token Waste

Re-establishing context every session burns tokens and time. You pay for the same explanations dozens of times, and the agent still misses unwritten context.

Cloud Memory Lock-In

The memory tools that ship with cloud agents live on someone else's server. Your hard-won knowledge sits in a vendor's database, locked behind their pricing and uptime.

Your agent doesn't need to be smarter. It needs to remember.

Sugar is the memory layer for your AI agents.

A local SQLite database your coding agent reads and writes through MCP. Context persists across sessions and across repos. Nothing leaves your machine.

ApproachWhat it doesWhere it falls short
Agent built-in memoryScratchpad for the current sessionGone when the session ends
Cloud memory toolsStore context on vendor serversLocked behind pricing and uptime
Wikis and READMEsDocument conventions in proseAgent has to find and read them
SugarLocal-first memory, semantic recall via MCPIt doesn't - context just shows up

Without Sugar

You: "We use RS256, not HS256."
You: "Async/await, never callbacks."
You: "Check __init__.py exports first."
Next session: Start over from zero

[re-explaining the same context every time]

With Sugar

Once: Store the decision in Sugar
Sugar: Recalled via semantic search
Agent: Applies it automatically
Every session: Context is just there

[context compounds, never repeats]

What Sugar Does

Local-first persistent memory for AI coding agents - with optional autonomous task execution built on top.

The memory layer
1

Project Memory

Per-repo memory stored in a local SQLite database. Decisions, conventions, error patterns, and file context persist across every session in that codebase.

2

Global Memory

Cross-project knowledge at ~/.sugar/memory.db. Team standards, shared architecture decisions, and tooling preferences surface in every repo automatically.

3

Semantic Search

Sentence-transformer embeddings plus FTS5 full-text search. Your agent recalls relevant context by meaning, not just keywords - with a LIKE fallback when vectors are unavailable.

4

MCP Native

Five MCP tools and three resources expose memory to Claude Code, Cursor, Goose, OpenCode, and any MCP-compatible client. Context shows up automatically in every session.

Optional: autonomous task execution

Task Orchestration

New in 3.10. Break large features into a 4-stage workflow - research, plan, implement, review - with specialist agent routing and dependency-ordered sub-tasks. The most capable way to run the task queue.

Task Queue

Queue bug fixes, features, tests, refactors, and docs. Sugar's executor runs them with full memory context and opens PRs. Optional - use Sugar purely as memory and never run a task.

GitHub Discovery

Watch repos for labeled issues - security, bug, dependabot, or your own. Matching issues become tasks automatically. Full control over which labels trigger action.

Verified PRs

The executor runs your test suite and quality gates before opening any PR. It iterates until tests pass - no broken fixes land in your repo.

Built on the memory layer

7 Memory Types

Decision, preference, file context, error pattern, research, outcome, and guideline - structured for accurate recall.

Zero-Config Setup

pip install sugarai, run sugar init, point your agent at the MCP server. No accounts, no cloud, no API keys required.

Local-First

Your memory lives in SQLite on your machine. No vendor lock-in, no uptime dependency, no pricing cliff.

Slash Commands

6 slash commands included for direct workflow integration from your agent's chat interface.

Store once. Recall forever.

Four steps. No cloud. Your agent's context just shows up.

Store
→
Local DB
→
Recall
→
Agent Uses It
1

Install and initialize

pip install sugarai, then sugar init. Sugar creates a local SQLite database and registers its MCP server. No accounts, no cloud, no API keys.

pip install sugarai && sugar init
2

Store context as you work

Capture decisions, conventions, error patterns, and file context through the CLI or MCP tools. Sugar indexes everything for semantic search.

sugar store decision "Auth uses RS256, not HS256"
3

Your agent recalls it automatically

Claude Code, Cursor, or any MCP client queries Sugar by meaning. Relevant context surfaces in every session - no re-explaining, no re-onboarding.

sugar recall "how do we handle authentication"
4

Context compounds across projects

Project memory stays scoped to its repo. Global memory - team standards, shared patterns - surfaces everywhere. Outcomes feed back automatically.

Anyone whose AI agent keeps forgetting their codebase.

If you re-explain your stack to Claude, Cursor, or Copilot in every session, Sugar is for you.

Solo Developers

You switch between projects and contexts constantly. Sugar remembers where you left off in each one - no re-onboarding yourself, no re-explaining conventions to your agent.

Small Teams

Store team standards and architectural decisions in global memory. Each developer runs Sugar locally and inherits the same conventions - onboarding a teammate's agent to your stack is one command, not a walkthrough.

Privacy-First Orgs

Your codebase knowledge stays on your machines in SQLite. No vendor servers, no cloud dependency, no data leaving your network. Local-first by design.

Give Your Agent a Memory.

Install Sugar in 30 seconds. Store your first memory. Your agent never starts from zero again.

$pip install sugarai