CodeBuddy × Nowledge Mem
Connect Tencent CodeBuddy to your shared memory with a CodeBuddy-native plugin, MCP tools, and automatic local thread sync.
For your agent
Paste this into CodeBuddy:
Read https://mem.nowledge.co/SKILL.md and follow the instructions to install or update Nowledge Mem for CodeBuddy. Verify with nmem status and the Context Bundle or Working Memory check, then run a short session and confirm the thread appears with nmem t list --source codebuddy.CodeBuddy can use Nowledge Mem through a native CodeBuddy plugin. The plugin gives CodeBuddy startup context, Mem MCP tools, quick commands, and lifecycle hooks that sync CodeBuddy's local transcript into Mem Threads.
This guide is for CodeBuddy Code, the terminal coding agent. For Tencent's office-agent surface, use the WorkBuddy guide; WorkBuddy uses the same plugin abstraction but stores configuration under .workbuddy.
Before You Start
- Nowledge Mem is running locally, or you have a reachable remote Mem server
- CodeBuddy Code is installed
nmemworks on the same machine as CodeBuddy
nmem status
codebuddy --versionIf nmem exists but rejects t sync --from codebuddy or config mcp show --host codebuddy, update the CLI before debugging MCP or session sync:
- Desktop-bundled CLI: open Mem and run Settings → Preferences → Developer Tools → Install bundled CLI again.
- PyPI CLI:
python3 -m pip install --user --upgrade nmem-cli - pipx CLI:
pipx upgrade nmem-cli
If CodeBuddy runs on a different machine from the Mem desktop app, install the standalone CLI there first and point it at your Mem server:
python3 -m pip install --user nmem-cli
nmem config client set url https://your-server
nmem config client set api-key your-keyInstall The Plugin
Add the Nowledge community marketplace, then install the plugin:
/plugin marketplace add nowledge-co/community
/plugin install nowledge-mem@nowledge-communityThe marketplace is backed by community/.codebuddy-plugin/marketplace.json. The plugin includes:
- a CodeBuddy plugin manifest
- a local MCP server for
http://127.0.0.1:14242/mcp/ - startup guidance and a Nowledge Mem skill
- hooks for
Stop,SessionEnd,PreCompact, andSubagentStop - quick commands under
/nowledge-mem:*
For remote Mem or authenticated localhost, generate a CodeBuddy MCP block:
nmem config mcp show --host codebuddyPaste the generated nowledge-mem server into ~/.codebuddy/.mcp.json, $CODEBUDDY_CONFIG_DIR/.mcp.json, or a project .mcp.json.
Thread Sync
CodeBuddy passes session_id and transcript_path to lifecycle hooks. The Nowledge Mem plugin uses those fields instead of guessing where the latest transcript is.
After install, the hook runs:
nmem --json t sync --from codebuddy --session-id <session-id> --session-dir <transcript_path> --all-projects --applyThat command runs on the CodeBuddy machine, reads the local .jsonl transcript under $CODEBUDDY_CONFIG_DIR/projects or ~/.codebuddy/projects, and uploads normalized messages to your local or remote Mem server. It is safe to rerun; Mem deduplicates repeated imports.
Verify
Start a new CodeBuddy session and ask:
Is Nowledge Mem connected? Read my current context.Success means CodeBuddy can call the Nowledge Mem MCP tools and return Context Bundle, Working Memory, or an empty-but-successful memory result.
Then finish a short exchange and check:
nmem t list --source codebuddy -n 5You should see the recent CodeBuddy thread after the hook has run. If hooks do not appear to run, check:
tail -n 50 ~/.codebuddy/logs/nowledge-mem-hook.logIf you set CODEBUDDY_CONFIG_DIR, check that directory's logs/nowledge-mem-hook.log instead.
Import Older Sessions
Preview first:
nmem t sync --from codebuddy --limit 20Import when the preview looks right:
nmem t sync --from codebuddy --applyFor a custom CodeBuddy config directory:
CODEBUDDY_CONFIG_DIR="$HOME/.my-codebuddy-config" nmem t sync --from codebuddy --applyCustomize Behavior
Use CodeBuddy's own instruction surfaces:
~/.codebuddy/CODEBUDDY.mdfor personal global guidance- project
CODEBUDDY.mdfor shared repo guidance .codebuddy/rules/*.mdfor structured project rules
Do not edit installed plugin files. Marketplace updates can replace them.
Related
- Connectors overview
- Threads
- CodeBuddy docs: Plugin Reference · Hooks Reference · MCP