Skip to content

Commit 635dcaa

Browse files
hanson meiclaude
andcommitted
Add Proma integration plugin for Nowledge Mem
Proma is a desktop AI agent built on Claude Agent SDK. This plugin provides the three-layer integration pattern: - MCP server config (mcp.json with "servers" top-level key) - Lifecycle hooks (Stop: auto-capture sessions, SessionStart: inject WM) - Companion skill (nmem: /nmem-save, /nmem-search, /nmem-status) Sessions are parsed from Proma's JSONL format (~/.proma/agent-sessions/<id>.jsonl) and uploaded to nmem via REST API. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent e3406bd commit 635dcaa

8 files changed

Lines changed: 732 additions & 0 deletions

File tree

integrations.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,55 @@
563563
"skills": [],
564564
"slashCommands": []
565565
},
566+
{
567+
"id": "proma",
568+
"name": "Proma",
569+
"category": "coding",
570+
"type": "plugin",
571+
"version": "0.1.0",
572+
"directory": "nowledge-mem-proma-plugin",
573+
"transport": "mcp",
574+
"capabilities": {
575+
"workingMemory": true,
576+
"search": true,
577+
"distill": true,
578+
"autoRecall": true,
579+
"autoCapture": true,
580+
"graphExploration": false,
581+
"status": true
582+
},
583+
"threadSave": {
584+
"method": "hook",
585+
"note": "Stop hook runs save-to-nmem.py which parses Proma session JSONL from ~/.proma/agent-sessions/ and uploads messages to nmem via REST API. SessionStart hook injects Working Memory via read-working-memory.py."
586+
},
587+
"autonomy": {
588+
"bootstrap": "automatic",
589+
"recall": "automatic",
590+
"distill": "automatic",
591+
"threads": "automatic-capture",
592+
"bestResultRequires": [
593+
"Add Nowledge Mem MCP server to ~/.proma/agent-workspaces/default/mcp.json (key: servers)",
594+
"Copy hook scripts to ~/.proma/hooks/",
595+
"Add Stop and SessionStart hooks to ~/.proma/settings.json",
596+
"Copy nmem skill to ~/.proma/agent-workspaces/default/skills/nmem/",
597+
"Add nmem usage guidance to CLAUDE.md for tool selection (nmem vs built-in MemOS)",
598+
"Restart Proma after configuration changes"
599+
]
600+
},
601+
"install": {
602+
"command": "Manual setup — see plugin README for step-by-step instructions",
603+
"updateCommand": "Replace hook scripts and skill files from latest plugin release",
604+
"detectionHint": "~/.proma/agent-workspaces/default/mcp.json contains nowledge-mem server",
605+
"docsUrl": "https://github.com/nowledge-co/community/tree/main/nowledge-mem-proma-plugin"
606+
},
607+
"toolNaming": {
608+
"convention": "mcp-backend",
609+
"prefix": "mcp__nowledge-mem__",
610+
"note": "MCP tools auto-prefixed by Proma Agent SDK; Proma also has built-in mcp__mem__ tools for session-level memory"
611+
},
612+
"skills": ["nmem"],
613+
"slashCommands": ["/nmem-save", "/nmem-search", "/nmem-status"]
614+
},
566615
{
567616
"id": "npx-skills",
568617
"name": "npx Skills",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "nowledge-mem",
3+
"description": "Personal knowledge graph for Proma — remembers decisions, searches past work, captures sessions across Proma workspaces",
4+
"version": "0.1.0",
5+
"author": {
6+
"name": "Nowledge Labs",
7+
"email": "hello@nowledge-labs.ai",
8+
"url": "https://nowledge-labs.ai"
9+
},
10+
"homepage": "https://mem.nowledge.co/",
11+
"repository": "https://github.com/nowledge-co/community.git",
12+
"license": "MIT",
13+
"keywords": [
14+
"memory",
15+
"knowledge-base",
16+
"semantic-search",
17+
"proma",
18+
"ai-tools",
19+
"personal-knowledge",
20+
"conversation-persistence",
21+
"context-management",
22+
"mcp",
23+
"claude-agent-sdk"
24+
]
25+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog — nowledge-mem-proma-plugin
2+
3+
## 0.1.0 (2026-05-12)
4+
5+
- Initial Proma integration
6+
- MCP server configuration template (`mcp.json`)
7+
- Stop hook: automatic session capture via `save-to-nmem.py`
8+
- SessionStart hook: Working Memory injection via `read-working-memory.py`
9+
- nmem Skill with slash commands (`/nmem-save`, `/nmem-search`, `/nmem-status`)
10+
- Proma session JSONL parser (dedup by UUID, extract text from content blocks)
11+
- nmem REST API client (reads credentials from `~/.nowledge-mem/config.json`)
12+
- Graceful fallback: hooks silent on error, skill works as manual alternative
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Nowledge Mem Plugin for Proma
2+
3+
Integrates Nowledge Mem's personal knowledge graph into Proma, providing persistent cross-session memory through MCP tools, lifecycle hooks, and a companion skill.
4+
5+
## Prerequisites
6+
7+
- [Proma](https://proma.ai) desktop app or CLI
8+
- Nowledge Mem server running (desktop app or remote)
9+
- Python 3.9+ (for hook scripts)
10+
- `nmem` CLI in PATH (bundled with [Nowledge Mem desktop app](https://mem.nowledge.co/), or `pip install nmem-cli`)
11+
12+
## Installation
13+
14+
### 1. Configure MCP Server
15+
16+
Add the Nowledge Mem MCP server to your Proma workspace `mcp.json`:
17+
18+
**Path:** `~/.proma/agent-workspaces/default/mcp.json`
19+
20+
```json
21+
{
22+
"servers": {
23+
"nowledge-mem": {
24+
"url": "http://127.0.0.1:14242/mcp/",
25+
"type": "streamableHttp",
26+
"headers": {
27+
"APP": "Proma",
28+
"Authorization": "Bearer <your-nmem-api-key>",
29+
"X-NMEM-API-Key": "<your-nmem-api-key>"
30+
}
31+
}
32+
}
33+
}
34+
```
35+
36+
For remote Mem setups, replace the URL with your remote server (e.g., `https://mem.example.com/mcp/`).
37+
38+
### 2. Install Hook Scripts
39+
40+
Copy the hook scripts to your Proma hooks directory:
41+
42+
```bash
43+
mkdir -p ~/.proma/hooks/
44+
cp hooks/save-to-nmem.py ~/.proma/hooks/
45+
cp hooks/read-working-memory.py ~/.proma/hooks/
46+
```
47+
48+
### 3. Enable Lifecycle Hooks
49+
50+
Merge the hooks configuration from `hooks/hooks.json` into `~/.proma/settings.json`:
51+
52+
```json
53+
{
54+
"hooks": {
55+
"Stop": [
56+
{
57+
"hooks": [
58+
{
59+
"type": "command",
60+
"command": "python \"<proma-home>/hooks/save-to-nmem.py\"",
61+
"timeout": 30,
62+
"async": true
63+
}
64+
]
65+
}
66+
],
67+
"SessionStart": [
68+
{
69+
"matcher": "startup|resume",
70+
"hooks": [
71+
{
72+
"type": "command",
73+
"command": "python \"<proma-home>/hooks/read-working-memory.py\"",
74+
"timeout": 10,
75+
"async": true
76+
}
77+
]
78+
}
79+
]
80+
}
81+
}
82+
```
83+
84+
Replace `<proma-home>` with your actual Proma home path (usually `~/.proma` on macOS/Linux or `C:\Users\<user>\.proma` on Windows).
85+
86+
### 4. Install the Skill
87+
88+
Copy the nmem skill to your Proma workspace:
89+
90+
```bash
91+
mkdir -p ~/.proma/agent-workspaces/default/skills/nmem/
92+
cp skills/nmem/SKILL.md ~/.proma/agent-workspaces/default/skills/nmem/
93+
```
94+
95+
### 5. (Recommended) Add CLAUDE.md Guidance
96+
97+
Add the following guidance to your CLAUDE.md so Proma knows when to use nmem vs built-in memory:
98+
99+
```markdown
100+
## Nowledge Mem (nmem) Usage
101+
102+
When nmem MCP tools (`mcp__nowledge-mem__*`) are available:
103+
104+
- **Cross-session persistence** -> nmem (`mcp__nowledge-mem__add_memory`)
105+
- **Within-session context** -> built-in `mcp__mem__*`
106+
- **Historical decisions, past discussions** -> `mcp__nowledge-mem__search_memories`
107+
- **Session archiving** -> `mcp__nowledge-mem__save_thread`
108+
109+
**Proactive behaviors:**
110+
- Read Working Memory at session start
111+
- Distill key decisions to nmem Memories
112+
- When user says "before", "last time": search nmem + built-in memory
113+
```
114+
115+
### 6. Restart Proma
116+
117+
Restart Proma for the MCP server and hooks to take effect. Verify with `/nmem-status` in a new session.
118+
119+
## Architecture
120+
121+
```
122+
Proma Agent
123+
|
124+
|-- mcp.json --> nmem MCP server (tools: search, save, status)
125+
|-- Stop Hook --> save-to-nmem.py (auto-capture sessions)
126+
|-- SessionStart Hook --> read-working-memory.py (inject context)
127+
|-- nmem Skill --> /nmem-save, /nmem-search, /nmem-status
128+
```
129+
130+
## How It Works
131+
132+
1. **MCP Tools**`mcp__nowledge-mem__*` tools are available to the agent for on-demand memory operations: search past decisions, save new learnings, read working memory.
133+
2. **Stop Hook** — After every agent response, `save-to-nmem.py` parses the current Proma session JSONL (`~/.proma/agent-sessions/<id>.jsonl`) and uploads the messages to nmem's thread store via REST API.
134+
3. **SessionStart Hook** — On new or resumed sessions, `read-working-memory.py` calls `nmem wm read` and outputs the briefing for context injection.
135+
4. **Skill** — Slash commands provide manual control as a fallback.
136+
137+
### Session Format
138+
139+
Proma stores sessions as JSONL files in `~/.proma/agent-sessions/`. Each line is a JSON object with:
140+
- `type`: `"user"` or `"assistant"`
141+
- `message.content`: array of content blocks (text, tool_use, tool_result, thinking)
142+
- `uuid`: unique message identifier
143+
144+
The save script deduplicates by UUID and extracts human-readable text from content blocks.
145+
146+
## Configuration
147+
148+
| Environment Variable | Purpose | Default |
149+
|---------------------|---------|---------|
150+
| `NMEM_API_URL` | nmem server URL | From `~/.nowledge-mem/config.json` |
151+
| `NMEM_API_KEY` | nmem API key | From `~/.nowledge-mem/config.json` |
152+
| `PROMA_HOME` | Proma home directory | `~/.proma` |
153+
154+
The hook scripts read credentials from standard nmem config (`~/.nowledge-mem/config.json`), so no duplicate configuration is needed if nmem is already set up on the machine.
155+
156+
## Troubleshooting
157+
158+
**MCP tools not showing up:**
159+
- Verify `mcp.json` uses `"servers"` (not `"mcpServers"`) as the top-level key
160+
- Check the API URL and key are correct
161+
- Restart Proma after changing `mcp.json`
162+
163+
**Hooks not firing:**
164+
- Check `~/.proma/log/nmem-hook.log` for errors
165+
- Verify Python 3.9+ is installed and in PATH
166+
- Ensure hook commands use correct absolute paths
167+
168+
**"nmem CLI not found":**
169+
- Install via `pip install nmem-cli` or the Nowledge Mem desktop app
170+
- Verify `nmem --version` works in your terminal
171+
172+
**Session not saved:**
173+
- Run the save script manually: `echo '{"session_id":"<id>"}' | python hooks/save-to-nmem.py`
174+
- Check the log at `~/.proma/log/nmem-hook.log`
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"hooks": {
3+
"Stop": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command",
8+
"command": "python \"${PROMA_HOME}/hooks/save-to-nmem.py\"",
9+
"timeout": 30,
10+
"async": true
11+
}
12+
]
13+
}
14+
],
15+
"SessionStart": [
16+
{
17+
"matcher": "startup|resume",
18+
"hooks": [
19+
{
20+
"type": "command",
21+
"command": "python \"${PROMA_HOME}/hooks/read-working-memory.py\"",
22+
"timeout": 10,
23+
"async": true
24+
}
25+
]
26+
}
27+
]
28+
}
29+
}

0 commit comments

Comments
 (0)