{"id":35500280,"url":"https://github.com/roboticforce/sugar","last_synced_at":"2026-04-20T19:31:35.995Z","repository":{"id":311635005,"uuid":"1042263006","full_name":"roboticforce/sugar","owner":"roboticforce","description":"Persistent memory for AI coding agents. Cross-session context, global knowledge, and autonomous task execution.","archived":false,"fork":false,"pushed_at":"2026-04-09T08:45:00.000Z","size":1968,"stargazers_count":67,"open_issues_count":4,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-09T10:09:53.783Z","etag":null,"topics":["ai-agents","ai-coding","ai-development","ai-memory","autonomous-ai","claude-code","context-management","cross-project","developer-tools","devtools","knowledge-management","mcp","mcp-server","model-context-protocol","opencode","persistent-memory","python","semantic-search","sqlite","vector-search"],"latest_commit_sha":null,"homepage":"https://sugar.roboticforce.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roboticforce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":"CLA.md"}},"created_at":"2025-08-21T18:26:58.000Z","updated_at":"2026-04-09T08:44:35.000Z","dependencies_parsed_at":"2025-08-25T17:50:22.202Z","dependency_job_id":"bb07ecbc-7a10-48a2-82b9-dd8305b9b9cf","html_url":"https://github.com/roboticforce/sugar","commit_stats":null,"previous_names":["cdnsteve/sugar","roboticforce/sugar"],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/roboticforce/sugar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticforce%2Fsugar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticforce%2Fsugar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticforce%2Fsugar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticforce%2Fsugar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roboticforce","download_url":"https://codeload.github.com/roboticforce/sugar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticforce%2Fsugar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","ai-coding","ai-development","ai-memory","autonomous-ai","claude-code","context-management","cross-project","developer-tools","devtools","knowledge-management","mcp","mcp-server","model-context-protocol","opencode","persistent-memory","python","semantic-search","sqlite","vector-search"],"created_at":"2026-01-03T18:20:44.738Z","updated_at":"2026-04-20T19:31:35.989Z","avatar_url":"https://github.com/roboticforce.png","language":"Python","readme":"# Sugar\n\nAutonomous issue resolution for AI-assisted development.\n\n\u003c!-- mcp-name: io.github.cdnsteve/sugar --\u003e\n\nSecurity scanners find vulnerabilities. Dependabot opens issues. Copilot flags problems.\nSugar reads the issue, writes the fix, runs the tests, and opens the PR.\n\n- **Discovers** - watches your GitHub repo for labeled issues (security, bug, dependabot)\n- **Resolves** - reads each issue and implements a fix using Claude\n- **Verifies** - runs your test suite and quality gates before committing\n- **Ships** - opens a PR referencing the original issue, ready for your review\n\nNo issue left sitting in a backlog waiting for someone to have time.\n\n## How Sugar Compares\n\nMost AI dev tools stop at the discovery layer:\n\n```\nGitHub Copilot CLI  -\u003e  scan  -\u003e  open issues\nSnyk                -\u003e  scan  -\u003e  open issues\nDependabot          -\u003e  scan  -\u003e  open issues\n```\n\nSugar is the resolution layer:\n\n```\nLabeled issue appears on GitHub\n  -\u003e Sugar picks it up (label filter: \"security\", \"dependabot\", \"bug\")\n  -\u003e AI agent reads the issue, analyzes the affected code\n  -\u003e Fix implemented, tests run locally\n  -\u003e PR opened - you review and merge\n```\n\nConfigure which labels Sugar watches, point it at your repo, and run `sugar run`.\n\nSee [workflow examples](docs/workflows/) for security auto-fix, bug triage, test coverage, and more.\n\n## What Sugar Does\n\nSugar combines persistent memory with autonomous task execution:\n\n- **Project memory** - Decisions, preferences, error patterns, and research stored per-project\n- **Global memory** - Standards and guidelines shared across every project you work on\n- **GitHub integration** - Watches for labeled issues and resolves them autonomously\n- **Semantic search** - Retrieve relevant context by meaning, not just keywords\n- **MCP integration** - Your AI agent reads and writes memory directly during sessions\n- **Task queue** - Hand off work to run autonomously, powered by the same memory layer\n\n## Quick Start\n\n```bash\n# Install once, use in any project\npipx install sugarai\n\n# Initialize in your project\ncd ~/dev/my-app\nsugar init\n\n# Store what you know\nsugar remember \"We use async/await everywhere, never callbacks\" --type preference\nsugar remember \"JWT tokens use RS256, expire in 15 min - see auth/tokens.py\" --type decision\nsugar remember \"When tests fail with import errors, check __init__.py exports first\" --type error_pattern\n\n# Retrieve it later\nsugar recall \"authentication\"\nsugar recall \"how do we handle async\"\n```\n\nYour AI agent can also read and write memory directly - no copy-pasting required.\n\n## MCP Integration\n\nConnect Sugar's memory to your AI agent so it can access project context automatically.\n\n**Claude Code - Memory server (primary):**\n```bash\nclaude mcp add sugar -- sugar mcp memory\n```\n\n**Claude Code - Task server (optional):**\n```bash\nclaude mcp add sugar-tasks -- sugar mcp tasks\n```\n\nOnce 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.\n\n**Other MCP clients (Goose, Claude Desktop):**\n```bash\n# Goose\ngoose configure\n# Select \"Add Extension\" -\u003e \"Command-line Extension\"\n# Name: sugar\n# Command: sugar mcp memory\n\n# OpenCode - one command setup\nsugar opencode setup\n```\n\n## Global Memory (New in 3.9)\n\nSome knowledge belongs to you, not just one project. Coding standards, preferred patterns, security practices - these should follow you everywhere.\n\n```bash\n# Store a guideline that applies to all your projects\nsugar remember \"Always validate and sanitize user input before any DB query\" \\\n  --type guideline --global\n\nsugar remember \"Use conventional commits: feat/fix/chore/docs/test\" \\\n  --type guideline --global\n\n# View your global guidelines\nsugar recall \"security\" --global\nsugar memories --global\n\n# Search works project-first, but guidelines always surface\nsugar recall \"database queries\"\n# Returns: project-specific memories + relevant global guidelines\n```\n\nGlobal 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.\n\n**Via MCP**, pass `scope: \"global\"` to `store_learning` to save cross-project knowledge directly from your AI session.\n\n**Memory types:** `decision`, `preference`, `file_context`, `error_pattern`, `research`, `outcome`, `guideline`\n\nFull docs: [Memory System Guide](docs/user/memory.md)\n\n## How Memory Works\n\nSugar uses two SQLite databases and a tiered search strategy.\n\n**Two stores:**\n- **Project store** (`.sugar/memory.db`) - context specific to one project\n- **Global store** (`~/.sugar/memory.db`) - knowledge that applies everywhere\n\n**Seven memory types**, each with different retrieval behavior:\n\n| Type | Purpose | TTL |\n|------|---------|-----|\n| `decision` | Architecture and implementation choices | Never |\n| `preference` | How you like things done | Never |\n| `file_context` | What files and modules do | Never |\n| `error_pattern` | Bugs and their fixes | 90 days |\n| `research` | API docs, library findings | 60 days |\n| `outcome` | What worked, what didn't | 30 days |\n| `guideline` | Cross-project standards and best practices | Never |\n\n**Search strategy - project-first with reserved guideline slots:**\n\n1. Search the project store first (local context always wins)\n2. Reserve slots for global guidelines (cross-project standards always surface)\n3. Fill remaining slots with other global results\n4. Deduplicate across both stores\n\nThis 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.\n\n**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.\n\n```bash\n# Install with semantic search (recommended)\npipx install 'sugarai[memory]'\n\n# Works without it too - just uses keyword matching\npipx install sugarai\n```\n\n**MCP tools available to your AI agent:**\n\n| Tool | What it does |\n|------|-------------|\n| `search_memory` | Search both stores, returns results with scope labels |\n| `store_learning` | Save a memory (pass `scope: \"global\"` for cross-project) |\n| `recall` | Get formatted markdown context for a topic |\n| `get_project_context` | Full project summary including global guidelines |\n| `list_recent_memories` | Browse recent memories by type |\n\n**MCP resources:**\n- `sugar://project/context` - project summary\n- `sugar://preferences` - coding preferences\n- `sugar://global/guidelines` - cross-project standards\n\n## Task Queue\n\nThe 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.\n\n```bash\n# Add tasks\nsugar add \"Fix authentication timeout\" --type bug_fix --urgent\nsugar add \"Add user profile settings\" --type feature\n\n# Start the autonomous loop\nsugar run\n```\n\nSugar 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.\n\n**Delegate from Claude Code mid-session:**\n```\n/sugar-task \"Fix login timeout\" --type bug_fix --urgent\n```\n\n**Advanced task options:**\n```bash\n# Orchestrated execution (research -\u003e plan -\u003e implement -\u003e review)\nsugar add \"Add OAuth authentication\" --type feature --orchestrate\n\n# Iterative mode - loops until tests pass\nsugar add \"Implement rate limiting\" --ralph --max-iterations 10\n\n# Check queue status\nsugar list\nsugar status\n```\n\nFull docs: [Task Orchestration](docs/task_orchestration.md)\n\n## Supported AI Tools\n\nWorks with any CLI-based AI coding agent:\n\n| Agent | Memory MCP | Task MCP | Notes |\n|-------|-----------|---------|-------|\n| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | Yes | Yes | Full support |\n| [OpenCode](https://github.com/opencode-ai/opencode) | Yes | Yes | `sugar opencode setup` |\n| [Goose](https://block.github.io/goose) | Yes | Yes | Via MCP |\n| [Aider](https://aider.chat) | Via CLI | Via CLI | Manual recall |\n\n## Installation\n\n**Recommended: pipx** - installs once, available everywhere, no venv conflicts:\n```bash\npipx install sugarai\n```\n\n**Upgrade / Uninstall:**\n```bash\npipx upgrade sugarai\npipx uninstall sugarai\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eOther installation methods\u003c/summary\u003e\n\n**pip** (requires venv activation each session)\n```bash\npip install sugarai\n```\n\n**uv**\n```bash\nuv pip install sugarai\n```\n\n**With semantic search (recommended for memory):**\n```bash\npipx install 'sugarai[memory]'\n```\n\n**With GitHub integration:**\n```bash\npipx install 'sugarai[github]'\n```\n\n**All features:**\n```bash\npipx install 'sugarai[all]'\n```\n\n\u003c/details\u003e\n\nSugar 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.\n\n## Project Structure\n\n```\n~/.sugar/\n└── memory.db          # Global memory (guidelines, cross-project knowledge)\n\n~/dev/my-app/\n├── .sugar/\n│   ├── sugar.db       # Project memory + task queue\n│   ├── config.yaml    # Project settings\n│   └── prompts/       # Custom agent prompts\n└── src/\n```\n\n**Recommended .gitignore:**\n```gitignore\n.sugar/sugar.db\n.sugar/sugar.log\n.sugar/*.db-*\n```\n\nCommit `.sugar/config.yaml` and `.sugar/prompts/` to share settings with your team.\n\n## Configuration\n\n`.sugar/config.yaml` is created on `sugar init`:\n\n```yaml\nsugar:\n  dry_run: false\n  loop_interval: 300\n  max_concurrent_work: 3\n\nclaude:\n  enable_agents: true\n\ndiscovery:\n  github:\n    enabled: true\n    repo: \"user/repository\"\n```\n\n## Documentation\n\n- [Quick Start](docs/user/quick-start.md)\n- [Memory System](docs/user/memory.md)\n- [CLI Reference](docs/user/cli-reference.md)\n- [Task Orchestration](docs/task_orchestration.md)\n- [Goose Integration](docs/user/goose.md)\n- [OpenCode Integration](docs/user/opencode.md)\n- [GitHub Integration](docs/user/github-integration.md)\n- [Configuration Guide](docs/user/configuration-best-practices.md)\n- [Troubleshooting](docs/user/troubleshooting.md)\n\n## Requirements\n\n- Python 3.11+\n- A CLI-based AI agent: [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [OpenCode](https://github.com/opencode-ai/opencode), [Aider](https://aider.chat), or similar\n\n## Contributing\n\nContributions welcome. See [CONTRIBUTING.md](docs/dev/contributing.md).\n\n```bash\ngit clone https://github.com/roboticforce/sugar.git\ncd sugar\nuv pip install -e \".[dev,test,github]\"\npytest tests/ -v\n```\n\n## License\n\n**Dual License: AGPL-3.0 + Commercial**\n\n- **Open Source (AGPL-3.0)**: Free for open source and personal use\n- **Commercial License**: For proprietary use - [sugar.roboticforce.io/licensing](https://sugar.roboticforce.io/licensing)\n\n---\n\n\u003e Sugar is provided \"AS IS\" without warranty. Review all AI-generated code before use.\n","funding_links":[],"categories":["AI Agents","AI","Software Development"],"sub_categories":["Multi-Agent","Agents"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboticforce%2Fsugar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froboticforce%2Fsugar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboticforce%2Fsugar/lists"}