Skip to content

Memory Dashboard API: REST endpoints for observability #574

@kovtcharov

Description

@kovtcharov

Summary

Build the FastAPI router for the Memory Dashboard. Exposes MemoryStore data via REST API for the frontend dashboard.

Spec: docs/spec/agent-memory-architecture.md → "Observability & Dashboard" → "UI Backend: Memory Router"

Depends on: #542 (MemoryStore)

File: src/gaia/ui/routers/memory.py

Endpoints

Dashboard

  • GET /api/memory/stats — aggregate stats (knowledge counts by category/context, conversation/tool totals, upcoming/overdue)
  • GET /api/memory/activity?days=30 — daily activity timeline

Knowledge Browser

  • GET /api/memory/knowledge — paginated, filterable (category, context, entity, sensitive, search), sortable
  • POST /api/memory/knowledge — create entry (source='user', confidence=0.8)
  • PUT /api/memory/knowledge/{id} — edit entry (all fields)
  • DELETE /api/memory/knowledge/{id} — delete entry

Entities & Contexts

  • GET /api/memory/entities — list unique entities with counts
  • GET /api/memory/entities/{entity} — all knowledge for an entity
  • GET /api/memory/contexts — list contexts with counts

Tool Performance

  • GET /api/memory/tools — per-tool stats (calls, success rate, avg duration, last error)
  • GET /api/memory/tools/{name}/history — call history for a tool

Errors & Conversations

  • GET /api/memory/errors — recent tool errors
  • GET /api/memory/conversations — session list with turn counts
  • GET /api/memory/conversations/{session_id} — full conversation
  • GET /api/memory/conversations/search — FTS5 search
  • GET /api/memory/upcoming?days=7 — time-sensitive items

DB Access

  • Read operations use read-only connection (?mode=ro)
  • Write operations (POST/PUT/DELETE) use short-lived read-write connections
  • WAL mode ensures concurrent reader safety

Acceptance Criteria

  • All 15 endpoints implemented
  • Pagination works on knowledge and tool history
  • Filters work (category, context, entity, sensitive, search)
  • Stats aggregation is correct
  • Activity timeline groups by day correctly
  • Router registered in server.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:agent-coreFramework, tools, registry, memory, skills, orchestrationtrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions