Viewer Rebuild Graph button calls missing /agentmemory/graph/build endpoint
Summary
In AgentMemory v0.9.18, the viewer's Rebuild Graph button appears to call an endpoint that does not exist: POST /agentmemory/graph/build. As a result, clicking the button does not rebuild/populate the graph.
Environment
- AgentMemory version: 0.9.18
- OS: Windows
- REST server:
http://localhost:3111 - Viewer:
http://localhost:3113 - LLM provider: Gemini configured via
~/.agentmemory/.env
Relevant feature flags are enabled according to agentmemory status and /agentmemory/config/flags:
GRAPH_EXTRACTION_ENABLED=true
CONSOLIDATION_ENABLED=true
AGENTMEMORY_AUTO_COMPRESS=true
AGENTMEMORY_INJECT_CONTEXT=true
agentmemory status reports:
Provider: llm
Embeddings: embeddings
Flags:
GRAPH_EXTRACTION_ENABLED enabled
CONSOLIDATION_ENABLED enabled
AGENTMEMORY_AUTO_COMPRESS enabled
AGENTMEMORY_INJECT_CONTEXT enabled
Graph: 0 nodes, 0 edges
What happened
The viewer shows the graph tab with 0 nodes and 0 edges. Clicking Rebuild Graph does not populate the graph.
Looking at src/viewer/index.html, the viewer attempts to call:
apiPost('graph/build', {})
That maps to:
POST /agentmemory/graph/build
However, searching the repo and testing locally suggests this route is not registered. The graph APIs that appear to exist are:
POST /agentmemory/graph/query
GET /agentmemory/graph/stats
POST /agentmemory/graph/extract
Direct test:
Invoke-RestMethod -Method Post -Uri http://localhost:3111/agentmemory/graph/build -Body '{}' -ContentType 'application/json'
Result:
404 Not Found
Additional observation
Calling POST /agentmemory/graph/extract without a body returns:
{
"error": "observations array is required"
}
So it seems graph/extract is not a drop-in replacement for rebuilding the graph from existing memories/observations.
There may also be a confusing failure mode where GET /agentmemory/config/flags reports GRAPH_EXTRACTION_ENABLED: true, while graph stats/query remain empty or report graph-disabled-style responses depending on the path/state.
Expected behavior
One of these should happen:
- The viewer's Rebuild Graph button should call a registered endpoint; or
- The server should implement
POST /agentmemory/graph/build; or - The button should be removed/renamed if graph backfill is not supported; or
- Documentation should explain that graph extraction only happens from new observations/session-end events and cannot rebuild existing memories.
Impact
Users can enable GRAPH_EXTRACTION_ENABLED=true successfully, but the viewer still shows an empty graph and the visible Rebuild Graph action does not work, making it look like the feature is broken or misconfigured.
this problem still exist at v0.9.20 version
@jonathanzhan1975 fixed: POST /agentmemory/graph/build exists and the rebuilt viewer in v0.9.30 confirms before calling it, holds an in-flight guard and reports the result. https://github.com/rohitg00/agentmemory/releases/tag/v0.9.30