Sugar

io.github.cdnsteve由 GitHub 帳號 cdnsteve 發布v3.4.2更新於 Oct 24, 2026

Autonomous AI development system with persistent task queue and background execution

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

Sugar 是給 AI 編碼代理使用的本地優先記憶層,讓助理透過 MCP 儲存並以語意搜尋專案與全域上下文。

可以做什麼
在專案庫與全域庫中搜尋與召回記憶,回傳附作用域標籤的結果,以及依主題整理的 Markdown 上下文(search_memory、recall)。在工作階段中儲存學習內容,可寫入全域作用域作為跨專案準則(store_learning)。讀取專案摘要、編碼偏好與全域準則,並依類型瀏覽近期記憶(get_project_context、list_recent_memories)。以 MCP 資源形式提供記憶,例如專案上下文、偏好與全域準則。選用的任務伺服器提供自主任務佇列,以設定好的 AI 代理執行工作。
適用情境
當 AI 編碼代理在每次工作階段之間遺失架構決策、慣例與錯誤模式,而你希望這些上下文依專案保存在本機並能跨專案共用時適用。若還想在同一記憶層上使用選用的自主任務佇列或 GitHub issue 自動修復,也值得考慮。
執行需求
以本機程序執行,來自 PyPI 套件 sugarai(pipx 或 pip),需要 Python 3.11+ 以及 Claude Code、OpenCode、Aider 等命令列 AI 代理。語意搜尋需安裝選用的 memory 附加元件,GitHub 整合需 github 附加元件。選用環境變數:ANTHROPIC_API_KEY、GITHUB_TOKEN、SUGAR_DEFAULT_REPO。資料以 SQLite 存於各專案的 .sugar/ 與全域的 ~/.sugar/。
安裝前請注意
選用的任務佇列與 GitHub issue 修復會讓 AI 代理自主執行、跑測試、提交程式碼並建立拉取請求,應審查其產出並考慮啟用 dry_run。GITHUB_TOKEN 與 ANTHROPIC_API_KEY 是伺服器可能使用的憑證,應限制其權限範圍。記憶資料庫保存在本機,README 建議加入 gitignore,避免提交私密上下文。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Sugar,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Sugar

Persistent memory for AI coding agents.

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.

Your memory. Your machine. Your data.

What Sugar Does

Sugar is a memory layer your AI coding agent can read and write directly:

  • Project memory - Decisions, preferences, error patterns, and research stored per-project
  • Global memory - Standards and guidelines shared across every project you work on
  • Semantic search - Retrieve relevant context by meaning, not just keywords
  • MCP integration - Your AI agent reads and writes memory directly during sessions
  • Local-first - SQLite on your disk, no API keys, fully offline-capable
  • Task queue - Optional autonomous execution, powered by the same memory layer

Quick Start

bash
# Install once, use in any projectpipx install sugarai
# Initialize in your projectcd ~/dev/my-appsugar init
# Store what you knowsugar remember "We use async/await everywhere, never callbacks" --type preferencesugar remember "JWT tokens use RS256, expire in 15 min - see auth/tokens.py" --type decisionsugar remember "When tests fail with import errors, check __init__.py exports first" --type error_pattern
# Retrieve it latersugar recall "authentication"sugar recall "how do we handle async"

Your AI agent can also read and write memory directly - no copy-pasting required.

MCP Integration

Connect Sugar's memory to your AI agent so it can access project context automatically.

Claude Code - Memory server (primary):

bash
claude mcp add sugar -- sugar mcp memory

Claude Code - Task server (optional):

bash
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.

Other MCP clients (Goose, Claude Desktop):

bash
# Goosegoose configure# Select "Add Extension" -> "Command-line Extension"# Name: sugar# Command: sugar mcp memory
# OpenCode - one command setupsugar 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).

SkillWhat it does
sugar-memoryStore and surface project context via Sugar's memory MCP server: recall context at task start, search before deciding, store learnings after completing work
sugar-task-plannerTurn a high-level task into a detailed execution plan: subtasks, dependencies, time estimates, risks, and measurable success criteria
sugar-quality-guardianReview code across quality, testing, security, and performance, ending with a structured verdict
sugar-orchestratorCoordinate multi-step workflows: analyze complexity, decompose tasks, assign roles, monitor execution

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.

Global Memory

Some knowledge belongs to you, not just one project. Coding standards, preferred patterns, security practices - these should follow you everywhere.

bash
# Store a guideline that applies to all your projectssugar 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 guidelinessugar recall "security" --globalsugar memories --global
# Search works project-first, but guidelines always surfacesugar 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

Full docs: Memory System Guide

How Memory Works

Sugar uses two SQLite databases and a tiered search strategy.

Two stores:

  • Project store (.sugar/memory.db) - context specific to one project
  • Global store (~/.sugar/memory.db) - knowledge that applies everywhere

Seven memory types, each with different retrieval behavior:

TypePurposeTTL
decisionArchitecture and implementation choicesNever
preferenceHow you like things doneNever
file_contextWhat files and modules doNever
error_patternBugs and their fixes90 days
researchAPI docs, library findings60 days
outcomeWhat worked, what didn't30 days
guidelineCross-project standards and best practicesNever

Search strategy - project-first with reserved guideline slots:

  1. Search the project store first (local context always wins)
  2. Reserve slots for global guidelines (cross-project standards always surface)
  3. Fill remaining slots with other global results
  4. Deduplicate across both stores

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.

bash
# Install with semantic search (recommended)pipx install 'sugarai[memory]'
# Works without it too - just uses keyword matchingpipx install sugarai

MCP tools available to your AI agent:

ToolWhat it does
search_memorySearch both stores, returns results with scope labels
store_learningSave a memory (pass scope: "global" for cross-project)
recallGet formatted markdown context for a topic
get_project_contextFull project summary including global guidelines
list_recent_memoriesBrowse recent memories by type

MCP resources:

  • sugar://project/context - project summary
  • sugar://preferences - coding preferences
  • sugar://global/guidelines - cross-project standards

Task Queue

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.

bash
# Add taskssugar add "Fix authentication timeout" --type bug_fix --urgentsugar add "Add user profile settings" --type feature
# Start the autonomous loopsugar 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.

Delegate from Claude Code mid-session:

/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.

bash
# Orchestrated execution - 4-stage workflow (New in 3.10)sugar add "Add OAuth authentication" --type feature --orchestrate
# Iterative mode - loops until tests passsugar add "Implement rate limiting" --ralph --max-iterations 10
# Check queue statussugar listsugar status

Full docs: Task Orchestration

Autonomous Issue Resolution (optional)

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.

Supported AI Tools

Works with any CLI-based AI coding agent:

AgentMemory MCPTask MCPNotes
Claude CodeYesYesFull support
OpenCodeYesYessugar opencode setup
GooseYesYesVia MCP
AiderVia CLIVia CLIManual recall

Installation

Recommended: pipx - installs once, available everywhere, no venv conflicts:

bash
pipx install sugarai

Upgrade / Uninstall:

bash
pipx upgrade sugaraipipx uninstall sugarai
Other installation methods

pip (requires venv activation each session)

bash
pip install sugarai

uv

bash
uv pip install sugarai

With semantic search (recommended for memory):

bash
pipx install 'sugarai[memory]'

With GitHub integration:

bash
pipx install 'sugarai[github]'

All features:

bash
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.

Project Structure

~/.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:

gitignore
.sugar/sugar.db.sugar/sugar.log.sugar/*.db-*

Commit .sugar/config.yaml and .sugar/prompts/ to share settings with your team.

Configuration

.sugar/config.yaml is created on sugar init:

yaml
sugar:  dry_run: false  loop_interval: 300  max_concurrent_work: 3
claude:  enable_agents: true
discovery:  github:    enabled: true    repo: "user/repository"

Documentation

Requirements

Contributing

Contributions welcome. See CONTRIBUTING.md.

bash
git clone https://github.com/roboticforce/sugar.gitcd sugaruv 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.

來源:README.md,提交 eade169

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v3.4.2最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。