Skip to content

feat: add full memory detail fields to UnifiedSearchResult - #688

Merged
ajianaz merged 1 commit into
developfrom
feat/unified-result-full-memory-fields
Jul 15, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/unified-result-full-memory-fields

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

UnifiedSearchResult (used by /recall with search_type) now includes all memory detail fields that SearchResult already had via its full Memory struct.

Changes

UnifiedSearchResult struct (types.rs)

Added 11 new fields with skip_serializing_if = "Option::is_none":

  • memory_type, namespace, source, source_type
  • importance, pinned, access_count
  • last_accessed, created_at, updated_at

Population sites (lib.rs)

  • recall_unified_memories() — all fields populated from Memory struct
  • recall_unified_documents() — all memory fields set to None
  • recall_unified_all() — both memory and document branches updated

Tests (types.rs)

  • Memory serde test: verifies new fields appear in JSON output + roundtrip
  • Document serde test: verifies new fields are omitted when None

CLI (output.rs)

  • print_unified_human() now shows type, source, importance, pinned 📌, access count

Before vs After

Before — search_type=memory response:**

{"content": "...", "memory_id": "...", "score": 0.85, "tags": [...], "metadata": {...}}

After — search_type=memory response:**

{"content": "...", "memory_id": "...", "score": 0.85, "tags": [...], "metadata": {...},
 "memory_type": "fact", "namespace": "default", "source": "user", "source_type": "user",
 "importance": 0.8, "pinned": false, "access_count": 5, "last_accessed": "...",
 "created_at": "...", "updated_at": "..."}

Document results are unaffected — all memory fields remain None and are omitted from JSON.

UnifiedSearchResult now includes memory_type, namespace, source,
source_type, importance, pinned, access_count, last_accessed,
created_at, updated_at.

- Memory results: all fields populated from Memory struct
- Document results: all memory-specific fields are None (skip_serializing_if)
- Tests verify both memory fields present and document fields omitted
- CLI print_unified_human shows new fields (type, source, importance, pinned, access count)

Fixes the gap where recall with search_type=all/memory/doc returned
less metadata than plain recall.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit ecdc19e into develop Jul 15, 2026
8 checks passed
@ajianaz
ajianaz deleted the feat/unified-result-full-memory-fields branch July 15, 2026 11:19
ajianaz added a commit that referenced this pull request Aug 13, 2026
…ory-fields

feat: add full memory detail fields to UnifiedSearchResult
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.

1 participant