Skip to content

Commit 48d4d6b

Browse files
Gemini MBclaude
andcommitted
fix(enrichment): use correct claude-mem search route and response format
The enrichment sidecar was calling POST /api/observations/search which does not exist in claude-mem. The correct endpoint is GET /api/search/observations with query params. Also fixes response parsing to handle MCP-style {content:[{type,text}]} format instead of {results:[...]}. Includes macbook config with intent and memory_api blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c32d18d commit 48d4d6b

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

config/macbook.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,14 @@
175175
"max_concurrent_sessions": 5,
176176
"receipt_all_actions": true,
177177
"sessions_file": "./data/acp-sessions.json"
178+
},
179+
"intent": {
180+
"baseUrl": "https://antfarm.world/api/v1",
181+
"apiKey": "antfarm_67efac6733223e873ab305e1e48e9c6a3f573eab38d07b00c8eabffd718d0b2b",
182+
"userId": "petrus"
183+
},
184+
"memory_api": {
185+
"baseUrl": "http://127.0.0.1:37777/api",
186+
"token": "0b5504e8bec4fb0eda198e4f45a2d10d8b21a70765bcd3737040c5570090dfbb"
178187
}
179188
}

src/team-relay/enrichment.mjs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ export async function enrichEvent(event, config = {}) {
2020
const memCfg = config.memory_api || {};
2121
if (memCfg.baseUrl && memCfg.token) {
2222
try {
23-
const url = `${memCfg.baseUrl}/observations/search`;
23+
const params = new URLSearchParams({ query: body, limit: '3' });
24+
const url = `${memCfg.baseUrl}/search/observations?${params}`;
2425
const resp = await fetch(url, {
25-
method: 'POST',
2626
headers: {
27-
'Content-Type': 'application/json',
2827
'Authorization': `Bearer ${memCfg.token}`
29-
},
30-
body: JSON.stringify({ query: body, limit: 3 })
28+
}
3129
});
3230

3331
if (!resp.ok) {
@@ -40,14 +38,14 @@ export async function enrichEvent(event, config = {}) {
4038
}
4139

4240
const data = await resp.json();
43-
if (data && data.results) {
44-
enriched.memory_context = {
45-
recent_observations: data.results.map(r => ({
46-
snippet: r.snippet,
47-
path: r.path,
48-
score: r.score
49-
}))
50-
};
41+
if (data && data.content) {
42+
// claude-mem returns MCP-style {content: [{type, text}]}
43+
const texts = data.content
44+
.filter(c => c.type === 'text' && c.text)
45+
.map(c => c.text);
46+
if (texts.length > 0) {
47+
enriched.memory_context = { raw: texts };
48+
}
5149
} else if (data && data.error) {
5250
addError(`Memory enrichment API error: ${data.error} - ${data.message || ''}`);
5351
}

0 commit comments

Comments
 (0)