Conversation
…ints
Dashboard viewer called these three list endpoints but only POST
/relations existed and /semantic + /procedural were never registered,
so the frontend received 404/405 and rendered empty dashboard cards
even when data was present.
Adds:
- api::semantic-list GET /agentmemory/semantic -> { semantic }
- api::procedural-list GET /agentmemory/procedural -> { procedural }
- api::relations-list GET /agentmemory/relations -> { relations }
Integration tests assert each endpoint returns 200 with an array.
Reported by Jay Ferguson running agentmemory with Hermes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThree new authenticated HTTP GET list endpoints were added to fetch agent memory data: semantic, procedural, and relations. Each endpoint validates authorization, retrieves the corresponding in-memory KV data, and returns it as a typed JSON response. Integration tests verify all three endpoints return HTTP 200 with expected array fields. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API as API Handler
participant Auth as Authorization
participant KV as In-Memory KV Store
Client->>API: GET /agentmemory/semantic
API->>Auth: checkAuth(req)
alt Auth Valid
Auth-->>API: Authorized
API->>KV: Fetch KV.semantic
KV-->>API: Return data
API->>API: Cast to SemanticMemory[]
API-->>Client: HTTP 200 { semantic: [...] }
else Auth Invalid
Auth-->>API: Unauthorized
API-->>Client: HTTP 401/403
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/triggers/api.ts`:
- Around line 1240-1280: Update the endpoint count badge in README.md from 104
to 107 so it matches the actual documented total (src/index.ts declares 107 REST
endpoints) and the three newly added GET endpoints ("api::semantic-list",
"api::procedural-list", "api::relations-list") registered in
src/triggers/api.ts; ensure the badge number and any other summary counts in
README.md are changed to 107 for consistency.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6e9c0e6a-9faa-46f9-9d9e-e3bce3fa1778
📒 Files selected for processing (2)
src/triggers/api.tstest/integration.test.ts
| sdk.registerFunction("api::semantic-list", | ||
| async (req: ApiRequest): Promise<Response> => { | ||
| const authErr = checkAuth(req, secret); | ||
| if (authErr) return authErr; | ||
| const semantic = await kv.list<import("../types.js").SemanticMemory>(KV.semantic); | ||
| return { status_code: 200, body: { semantic } }; | ||
| }, | ||
| ); | ||
| sdk.registerTrigger({ | ||
| type: "http", | ||
| function_id: "api::semantic-list", | ||
| config: { api_path: "/agentmemory/semantic", http_method: "GET" }, | ||
| }); | ||
|
|
||
| sdk.registerFunction("api::procedural-list", | ||
| async (req: ApiRequest): Promise<Response> => { | ||
| const authErr = checkAuth(req, secret); | ||
| if (authErr) return authErr; | ||
| const procedural = await kv.list<import("../types.js").ProceduralMemory>(KV.procedural); | ||
| return { status_code: 200, body: { procedural } }; | ||
| }, | ||
| ); | ||
| sdk.registerTrigger({ | ||
| type: "http", | ||
| function_id: "api::procedural-list", | ||
| config: { api_path: "/agentmemory/procedural", http_method: "GET" }, | ||
| }); | ||
|
|
||
| sdk.registerFunction("api::relations-list", | ||
| async (req: ApiRequest): Promise<Response> => { | ||
| const authErr = checkAuth(req, secret); | ||
| if (authErr) return authErr; | ||
| const relations = await kv.list<import("../types.js").MemoryRelation>(KV.relations); | ||
| return { status_code: 200, body: { relations } }; | ||
| }, | ||
| ); | ||
| sdk.registerTrigger({ | ||
| type: "http", | ||
| function_id: "api::relations-list", | ||
| config: { api_path: "/agentmemory/relations", http_method: "GET" }, | ||
| }); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -nP --type=ts -C2 '\b(agentmemory/(semantic|procedural|relations))\b' index.ts src 2>/dev/null
rg -nP -C2 '\b(endpoints?|routes?)\b.*\d+' README.md | head -40Repository: rohitg00/agentmemory
Length of output: 1799
🏁 Script executed:
cat -n README.md | grep -E -A2 -B2 "(endpoint|route)" | head -60Repository: rohitg00/agentmemory
Length of output: 2946
🏁 Script executed:
fd index.ts --type f && cat -n index.ts | grep -i endpointRepository: rohitg00/agentmemory
Length of output: 270
🏁 Script executed:
cat -n src/index.ts | grep -i -E "(endpoint|count|register)"Repository: rohitg00/agentmemory
Length of output: 7732
🏁 Script executed:
cat src/index.tsRepository: rohitg00/agentmemory
Length of output: 15847
Fix the endpoint count badge in README.md to match the documented total.
The three new GET endpoints are correctly added to src/triggers/api.ts (lines 1251, 1265, 1279), and src/index.ts line 321 already declares 107 REST endpoints. However, the README.md badge on line 137 shows 104 endpoints while line 854 states 107 endpoints. Update the badge to 107 to match the actual endpoint count and the README text.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/triggers/api.ts` around lines 1240 - 1280, Update the endpoint count
badge in README.md from 104 to 107 so it matches the actual documented total
(src/index.ts declares 107 REST endpoints) and the three newly added GET
endpoints ("api::semantic-list", "api::procedural-list", "api::relations-list")
registered in src/triggers/api.ts; ensure the badge number and any other summary
counts in README.md are changed to 107 for consistency.
Summary
Dashboard viewer (port 3113) calls three list endpoints that never reached the REST server (3111):
GET /agentmemory/semantic— no handler registered → 404GET /agentmemory/procedural— no handler registered → 404GET /agentmemory/relations— onlyPOSTregistered → 405Because
loadDashboard()fans out withPromise.all, the cards for these sections stayed empty even when memories, sessions, and crystals fetched cleanly. Jay Ferguson hit this while running agentmemory with Hermes — he saw{ memories: Array(3) }arriving but cards stuck on 0.Fix
Added three auth-gated GET handlers next to
api::memoriesinsrc/triggers/api.ts:api::semantic-listGET /agentmemory/semantic{ semantic: SemanticMemory[] }api::procedural-listGET /agentmemory/procedural{ procedural: ProceduralMemory[] }api::relations-listGET /agentmemory/relations{ relations: MemoryRelation[] }Each handler reads from the same
KV.semantic/KV.procedural/KV.relationskeys thatmesh/exportalready uses. Shapes match whatrenderDashboardparses insrc/viewer/index.html:The existing
POST /agentmemory/relations(create-edge) is untouched; iii's trigger registry routes (path, method) pairs independently — same pattern as/agentmemory/actionsPOST/GET.Test plan
npm run build— cleannpm test— 776 pass (unrelated fs-watcher timing flake)npx tsc --noEmit— no new errorstest/integration.test.tsasserting each endpoint returns 200 with an arrayFixes the user-visible issue in https://x.com/fergusonJC/status/... (empty dashboard with Hermes).
Summary by CodeRabbit
New Features
Tests