Skip to content

feat: Fill UtekeClient gaps — 5 high-priority endpoints (PUT /memory, /room/remember, /import, /export, /context) #216

Description

@ajianaz

Problem

UtekeClient covers 35/53 Uteke endpoints (66%). Audit found 5 high-priority gaps that limit Corin functionality:

Endpoint Method What It Does Impact
PUT /memory PUT Update memory content/metadata Corin cannot edit existing memories
POST /room/remember POST Store memory linked to a room Room-specific creation missing
POST /import POST Import JSON memories via Uteke API Corin handles import via IPC, not API
GET /export GET Export all memories via Uteke API Same — IPC only, no API path
POST /context POST Context window for LLM enrichment MCP-relevant for agent integration

Scope

1. PUT /memory — Memory Update

pub async fn memory_update(&self, id: &str, content: Option<&str>, tags: Option<Vec<String>>) -> Result<(), String>
  • Call PUT {base_url}/memory with body {"id": "...", "content": "...", "tags": [...]}
  • Add Tauri command memory_update
  • Wire to Svelte MemoryDetail edit flow

2. POST /room/remember — Room Memory Create

pub async fn room_remember(&self, room_id: &str, content: &str, tags: Vec<String>, author: Option<&str>) -> Result<UtekeMemory, String>
  • Call POST {base_url}/room/remember
  • Different from /remember — links memory to room at creation time
  • Add Tauri command room_remember
  • Wire to RoomDetail compose UI

3. POST /import — API-Level Import

  • Corin currently imports via IPC layer (read JSON file → parse → loop /remember)
  • Direct /import endpoint is batch-optimized (single request)
  • Wrap as pub async fn import(&self, memories: Vec<ImportEntry>) -> Result<ImportResult, String>

4. GET /export — API-Level Export

  • Same story — Corin exports via IPC (loop list → assemble JSON)
  • Direct /export?namespace=X returns full dump in one call
  • Wrap as pub async fn export(&self, namespace: Option<&str>) -> Result<Vec<UtekeMemory>, String>

5. POST /context — Context Enrichment

  • Returns context window for a query (top memories + graph context)
  • Useful for MCP server integration and AI agent workflows
  • Wrap as pub async fn context(&self, query: &str, limit: usize) -> Result<serde_json::Value, String>

Lower-Priority Gaps (not in scope)

These exist but can wait:

  • /memory/pin (modern — Corin uses legacy /pin)
  • /memory/importance (get/set score)
  • /prune, /consolidate, /aging, /orphans, /extract, /rebuild-backlinks (maintenance batch ops)
  • /room/document/list, /room/document/add, /room/document/remove, /doc/room/list (room-doc junction)
  • /mcp (Corin has own MCP server)
  • /recent (list already covers this via sort)

Acceptance Criteria

  • 5 new UtekeClient methods with proper error handling
  • 5 new Tauri commands registered in lib.rs
  • IPC exports in ipc.ts
  • PUT /memory wired to MemoryDetail edit UI
  • POST /room/remember wired to RoomDetail compose UI
  • Import/Export refactored to use API endpoints
  • /context exposed as MCP tool
  • CI green (clippy, fmt, type-check, vitest, cora review)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/highImportant, next sprintscope/backendRust backend / Tauri commandsscope/utekeUteke-core integration layer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions