Skip to content

feat(memory): connect graph query and doc ingest APIs#124

Merged
senamakel merged 7 commits into
tinyhumansai:mainfrom
sanil-23:feat/connect-memory-apis
Mar 31, 2026
Merged

feat(memory): connect graph query and doc ingest APIs#124
senamakel merged 7 commits into
tinyhumansai:mainfrom
sanil-23:feat/connect-memory-apis

Conversation

@sanil-23
Copy link
Copy Markdown
Contributor

@sanil-23 sanil-23 commented Mar 31, 2026

Summary

  • Wire up memory.graph.query RPC endpoint (Rust dispatch + frontend wrapper) to load graph relations from the local store
  • Add memory.doc.ingest RPC endpoint and frontend memoryDocIngest() wrapper for triggering document ingestion from the UI
  • Integrate graph relations into MemoryWorkspace: display relation triples (subject → predicate → object), compute entity nodes from local graph data with fallback to backend API counts

Problem

  • The frontend MemoryWorkspace had no way to query the local semantic graph or trigger document ingestion via RPC
  • Entity counts in the intelligence view relied solely on backend API responses with no local graph awareness
  • No UI surface existed to visualize graph relations (subject → predicate → object triples)

Solution

  • Rust backend: Added IngestDocParams struct and doc_ingest() handler in ops.rs, routed memory.doc.ingest in dispatch.rs
  • Frontend wrappers: Added GraphRelation type, memoryGraphQuery(), and memoryDocIngest() in tauriCommands.ts
  • UI integration: MemoryWorkspace.tsx now loads graph relations on workspace init, computes entity nodes from local relations (with fallback to backend counts), and renders a scrollable relations panel showing up to 20 triples with evidence counts
File What
src/openhuman/memory/ops.rs IngestDocParams struct + doc_ingest() handler
src/rpc/dispatch.rs Route memory.doc.ingest to handler
app/src/utils/tauriCommands.ts GraphRelation type, memoryGraphQuery(), memoryDocIngest()
app/src/components/intelligence/MemoryWorkspace.tsx Graph relations loading, entity computation, relations UI

Submission Checklist

  • Unit tests — Pending: Rust unit tests for doc_ingest handler, Vitest tests for MemoryWorkspace graph relations rendering
  • E2E / integration — Pending: JSON-RPC E2E test for memory.doc.ingest and memory.graph.query methods
  • Doc commentsIngestDocParams and doc_ingest() follow existing crate conventions; GraphRelation type is self-documenting
  • Inline comments — Entity node computation fallback logic is documented in-line

Impact

  • Desktop only — all changes go through Tauri core_rpc_relay; no mobile/web impact
  • No breaking changes — new RPC methods are additive; existing MemoryWorkspace behavior preserved via fallback path
  • Performance — graph query is fire-and-forget on workspace load; no blocking impact on initial render

Related

🤖 Generated with Claude Code

Wire up memory.graph.query and memory.doc.ingest RPC endpoints and
integrate graph relations into the MemoryWorkspace UI, replacing
backend-only entity counts with local graph store data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sanil-23 sanil-23 marked this pull request as draft March 31, 2026 15:58
jainsanil18 and others added 6 commits March 31, 2026 21:36
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… routing

Cover the new graph query and doc ingest APIs added in this PR:
- Rust dispatch tests: routing, param validation, unknown method fallthrough
- Frontend tauriCommands tests: Tauri guard, RPC forwarding for memoryGraphQuery/memoryDocIngest
- MemoryWorkspace component tests: graph relations rendering, evidence badges, empty states

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sanil-23 sanil-23 marked this pull request as ready for review March 31, 2026 17:58
@senamakel senamakel merged commit 4d3b638 into tinyhumansai:main Mar 31, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants