Skip to content

Commit 59b8da6

Browse files
Petrus PennanenPetrus Pennanen
authored andcommitted
docs(README): document v0.5.0 memory payload shapes and verification commands
1 parent 5558acf commit 59b8da6

1 file changed

Lines changed: 72 additions & 1 deletion

File tree

README.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ To enable sidecar enrichment (Memory and Intent), add the following blocks to yo
204204
{
205205
"intent": {
206206
"baseUrl": "https://antfarm.world/api/v1",
207-
"apiKey": "xfb_your_key",
207+
"apiKey": "antfarm_your_key",
208208
"userId": "your_user_id"
209209
},
210210
"memory_api": {
@@ -216,6 +216,77 @@ To enable sidecar enrichment (Memory and Intent), add the following blocks to yo
216216

217217
*Note: The Intent API integration is now fully LIVE and actively polls for user-intent-kit data upon every incoming message. Ensure your `"apiKey"` uses an `antfarm_...` prefix. The sidecar securely passes `Authorization: Bearer` and injects `urgency_mode` vectors directly into your queued room events.*
218218

219+
When enrichment is enabled, each queued room event can be expanded with:
220+
221+
- `intent`: the full JSON payload returned by `GET /intent/{userId}`, plus `provider: "antfarm"`.
222+
- `memory_context.raw`: an array of text snippets returned by Claude-Mem search.
223+
- `enrichment_errors`: fetch or schema problems encountered while calling either upstream service.
224+
225+
The current Claude-Mem context retrieval path is message-driven. For each incoming room message, the sidecar uses the message body as the search query and calls:
226+
227+
```text
228+
GET {memory_api.baseUrl}/search/observations?query=<message body>&limit=3
229+
Authorization: Bearer <memory_api.token>
230+
```
231+
232+
The response is expected to be MCP-style JSON:
233+
234+
```json
235+
{
236+
"content": [
237+
{ "type": "text", "text": "..." }
238+
]
239+
}
240+
```
241+
242+
All returned `content[]` entries with `type: "text"` are copied into `memory_context.raw`. This is how prior Claude-Mem observations are threaded back into queue events for downstream agents.
243+
244+
Example enriched event shape:
245+
246+
```json
247+
{
248+
"kind": "antfarm.message.created",
249+
"payload": {
250+
"body": "can we ship the release notes today?",
251+
"room": "thinkoff-development"
252+
},
253+
"intent": {
254+
"user_id": "petrus",
255+
"derived": {
256+
"urgency_mode": "emergency-only"
257+
},
258+
"provider": "antfarm"
259+
},
260+
"memory_context": {
261+
"raw": [
262+
"Recent Claude-Mem observation text"
263+
]
264+
},
265+
"enrichment_errors": []
266+
}
267+
```
268+
269+
### Verify Enrichment
270+
271+
Verify the two upstream integrations independently before debugging the poller:
272+
273+
```bash
274+
# 1. Intent lookup should return HTTP 200 JSON
275+
curl -i \
276+
-H "Authorization: Bearer antfarm_your_key" \
277+
"https://antfarm.world/api/v1/intent/your_user_id"
278+
279+
# 2. Claude-Mem lookup should return HTTP 200 JSON with a content[] array
280+
curl -i \
281+
-H "Authorization: Bearer your_claude_mem_token" \
282+
"http://127.0.0.1:37777/api/search/observations?query=release%20notes&limit=3"
283+
```
284+
285+
Latest local verification from the Petrus machine before the `v0.5.0` release:
286+
287+
- `GET /intent/petrus` returned `200` on `2026-03-31`.
288+
- `GET /api/search/observations?query=thinkoff&limit=3` returned `200` on `2026-03-31`.
289+
219290
## Integrations
220291

221292
### GitHub Webhooks (`src/webhook-server.mjs`)

0 commit comments

Comments
 (0)