Persistent memory for AI coding agents. Local-first, cross-session context, global knowledge, and optional autonomous task execution.
pip install sugarai==3.10.4 Copy PIP instructions
Your AI agent starts every session with amnesia. The architecture decisions, conventions, and gotchas you explained last week are gone. Sugar is the local-first memory layer that remembers them for you - per project, across projects, on your machine.
Sugar is a memory layer your AI coding agent can read and write directly:
Connect Sugar's memory to your AI agent so it can access project context automatically.
claude mcp add sugar -- sugar mcp memory Claude Code - Task server (optional):
claude mcp add sugar-tasks -- sugar mcp tasks Once connected, Claude can call store_learning to save context mid-session and search_memories to pull relevant knowledge before starting work. The memory server works from any directory - global memory is always available even outside a Sugar project.
# Goose goose configure # Select "Add Extension" -> "Command-line Extension" # Name: sugar # Command: sugar mcp memory # OpenCode - one command setup sugar opencode setup Skills Sugar ships Agent Skills - folders of instructions that teach coding agents to apply Sugar's methodology. Skills live under skills/ and follow the Agent Skills specification (a SKILL.md with name/description frontmatter plus instructions).
Each skill includes an evaluation dataset (evals/evals.json) and is measured with NVIDIA SkillEvaluator against the OpenCode harness. See Skill Benchmarks for the Skill Lift results - sugar-memory and sugar-task-planner both show measured positive lift.
Some knowledge belongs to you, not just one project. Coding standards, preferred patterns, security practices - these should follow you everywhere.
# Store a guideline that applies to all your projects sugar remember "Always validate and sanitize user input before any DB query" \ --type guideline --global sugar remember "Use conventional commits: feat/fix/chore/docs/test" \ --type guideline --global # View your global guidelines sugar recall "security" --global sugar memories --global # Search works project-first, but guidelines always surface sugar recall "database queries" # Returns: project-specific memories + relevant global guidelines Global memory lives at ~/.sugar/memory.db. Project memory lives at .sugar/memory.db. When you search, project context wins - but guideline type memories from global always appear in results so your standards stay visible.
Via MCP, pass scope: "global" to store_learning to save cross-project knowledge directly from your AI session.
Memory types: decision, preference, file_context, error_pattern, research, outcome, guideline
Sugar uses two SQLite databases and a tiered search strategy.
Seven memory types, each with different retrieval behavior:
Search strategy - project-first with reserved guideline slots:
This means a mature project's local context dominates results. A new project with no local memory gets global knowledge automatically. And your guidelines are always visible regardless.
Search engine: Semantic search via sentence-transformers (all-MiniLM-L6-v2, 384-dim vectors) with sqlite-vec. Falls back to SQLite FTS5 keyword search, then LIKE queries. No external API calls - everything runs locally.
# Install with semantic search (recommended) pipx install 'sugarai[memory]' # Works without it too - just uses keyword matching pipx install sugarai MCP tools available to your AI agent:
The task queue lets you hand off work and let it run autonomously. It reads from the same memory store, so Sugar already knows your preferences and patterns before it starts.
# Add tasks sugar add "Fix authentication timeout" --type bug_fix --urgent sugar add "Add user profile settings" --type feature # Start the autonomous loop sugar run Sugar picks up tasks, executes them with your configured AI agent, runs tests, commits working code, and moves to the next task. It runs until the queue is empty or you stop it.
/sugar-task "Fix login timeout" --type bug_fix --urgent Advanced task options: New in 3.10: Task Orchestration decomposes large features into a 4-stage workflow (research, plan, implement, review) with specialist agent routing and dependency-ordered sub-tasks.
# Orchestrated execution - 4-stage workflow (New in 3.10) sugar add "Add OAuth authentication" --type feature --orchestrate # Iterative mode - loops until tests pass sugar add "Implement rate limiting" --ralph --max-iterations 10 # Check queue status sugar list sugar status Full docs: Task Orchestration
Because Sugar remembers your codebase and conventions, it can also resolve routine issues autonomously. Point it at a GitHub repo, configure which labels to act on (security, bug, dependabot), and Sugar will read each issue, implement the fix, run your tests, and open a PR.
Labeled issue appears on GitHub -> Sugar picks it up (label filter: "security", "dependabot", "bug") -> AI agent reads the issue, analyzes the affected code -> Fix implemented, tests run locally -> PR opened - you review and merge This is one application of the memory layer, not the headline. Use Sugar purely as memory, or enable resolution - your choice. See workflow examples for security auto-fix, bug triage, test coverage, and more.
Recommended: pipx - installs once, available everywhere, no venv conflicts:
pipx upgrade sugarai pipx uninstall sugarai Other installation methods pip (requires venv activation each session)
uv pip install sugarai With semantic search (recommended for memory):
pipx install 'sugarai[memory]' With GitHub integration:
pipx install 'sugarai[all]' Sugar is project-local by default. Each project gets its own .sugar/ folder with its own database and config. Global memory lives at ~/.sugar/. Like git - one installation, per-project state.
~/.sugar/ └── memory.db # Global memory (guidelines, cross-project knowledge) ~/dev/my-app/ ├── .sugar/ │ ├── sugar.db # Project memory + task queue │ ├── config.yaml # Project settings │ └── prompts/ # Custom agent prompts └── src/ Recommended .gitignore:
.sugar/sugar.db .sugar/sugar.log .sugar/*.db-* Commit .sugar/config.yaml and .sugar/prompts/ to share settings with your team.
sugar: dry_run: false loop_interval: 300 max_concurrent_work: 3 claude: enable_agents: true discovery: github: enabled: true repo: "user/repository" Documentation Quick Start Memory System Skill Benchmarks CLI Reference Task Orchestration Goose Integration OpenCode Integration GitHub Integration Configuration Guide Troubleshooting Requirements Python 3.11+ A CLI-based AI agent: Claude Code, OpenCode, Aider, or similar Contributing Contributions welcome. See CONTRIBUTING.md.
git clone https://github.com/roboticforce/sugar.git cd sugar uv pip install -e ".[dev,test,github]" pytest tests/ -v License Dual License: AGPL-3.0 + Commercial
Sugar is provided "AS IS" without warranty. Review all AI-generated code before use.
All 2 files in this release have provenance metadata.
GNU Affero General Public License v3 or later (AGPLv3+) (AGPL-3.0-or-later)
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Jan 8, 2026 2 release files Change of provenance
Jan 7, 2026 2 release files Change of provenance
Dec 21, 2025 2 release files Change of provenance




