Skip to content

feat(#251): metadata enrichment — entity, category, meta CLI flags - #262

Merged
ajianaz merged 2 commits into
developfrom
feat/251-metadata-enrichment
Jun 10, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/251-metadata-enrichment

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Enrich memory entries with structured metadata via new CLI flags.

New CLI flags on remember

uteke remember "Server deploy ke staging" \
  --tags deploy \
  --entity "staging-server" \
  --category infrastructure \
  --meta "source:meeting-note,confidence:0.9"

New filter flags on recall and list

uteke recall "staging" --entity staging-server
uteke list --category infrastructure

Implementation

  • --entity <name> — entity identifier in metadata JSON
  • --category <cat> — category classification in metadata JSON
  • --meta key:value,... — arbitrary key-value pairs with auto type detection (number, bool, string)
  • Metadata stored in existing metadata column (no schema change)
  • Post-filter on recall/list by metadata.entity and metadata.category

Verification

  • ✅ cargo clippy --all-targets -- -D warnings — clean
  • ✅ cargo test — 107/107 pass
  • ✅ Backward compatible — no schema change, existing memories unaffected

Fixes: #251

- New CLI flags on remember: --entity, --category, --meta key:value,...
- Metadata stored as JSON in existing metadata column (no schema change)
- --meta parses key:value pairs with auto type detection (number, bool, string)
- recall --entity/--category: post-filter results by metadata fields
- list --entity/--category: filter listed memories by metadata fields
- JSON output includes metadata when present
- Human-readable output shows entity/category when set

Fixes: #251
@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@ajianaz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 29 minutes and 15 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6ac9268e-b5a0-4373-943d-2825516b4bb0

📥 Commits

Reviewing files that changed from the base of the PR and between 209c42d and 8d18e3c.

📒 Files selected for processing (6)
  • crates/uteke-cli/src/commands/list.rs
  • crates/uteke-cli/src/commands/mod.rs
  • crates/uteke-cli/src/commands/recall.rs
  • crates/uteke-cli/src/commands/remember.rs
  • crates/uteke-cli/src/commands/server.rs
  • crates/uteke-cli/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/251-metadata-enrichment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

❌ Blocked — critical issues found.

🔴 Error (3)

  • crates/uteke-cli/src/commands/remember.rs:86 — The call obj.as_object_mut().unwrap() can panic if obj is not a JSON object. While serde_json::json!({}) currently always produces an object, this is fragile and the static analyzer also flagged it. Use if let Some(map) = obj.as_object_mut() or handle the error gracefully.
  • crates/uteke-cli/src/commands/remember.rs:134 — Same issue as line 86 — obj.as_object_mut().unwrap() in the non-contradiction branch can panic. This is the second occurrence of the same pattern.
  • crates/uteke-cli/src/commands/server.rs:49 — The server command handler destructures entity, category, and meta with _ prefixes, silently ignoring them. This means uteke remember --entity foo --server will not include the entity metadata in the request. Users will get no warning that these flags are unsupported in server mode.

Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit 9b897af into develop Jun 10, 2026
9 checks passed
@ajianaz
ajianaz deleted the feat/251-metadata-enrichment branch June 10, 2026 01:39
ajianaz added a commit that referenced this pull request Jun 10, 2026
* fix: address Cora review critical issues (7 items)

FTS5 (from PR #261):
- Fix BM25 score conversion: rank is negative unbounded, clamping to
  0..1 produced 0.0 for all results. Now uses rank-based scoring
  (placeholder 1.0) since actual ranking is done by RRF in hybrid.
- Fix RRF normalization: denominator calculation was correct but
  .min(1.0) was misleading. Replaced with explicit .clamp(0.0, 1.0).
- Replace memories.remove().unwrap() with expect() for clearer panic msg.

Metadata (from PR #262):
- Replace as_object_mut().unwrap() with if-let pattern to prevent panic.
- Server-mode remember now includes entity/category/meta in request body
  instead of silently ignoring them.

* style: cargo fmt
ajianaz added a commit that referenced this pull request Aug 13, 2026
)

* feat(#251): metadata enrichment — entity, category, meta CLI flags

- New CLI flags on remember: --entity, --category, --meta key:value,...
- Metadata stored as JSON in existing metadata column (no schema change)
- --meta parses key:value pairs with auto type detection (number, bool, string)
- recall --entity/--category: post-filter results by metadata fields
- list --entity/--category: filter listed memories by metadata fields
- JSON output includes metadata when present
- Human-readable output shows entity/category when set

Fixes: #251

* style: cargo fmt
ajianaz added a commit that referenced this pull request Aug 13, 2026
* fix: address Cora review critical issues (7 items)

FTS5 (from PR #261):
- Fix BM25 score conversion: rank is negative unbounded, clamping to
  0..1 produced 0.0 for all results. Now uses rank-based scoring
  (placeholder 1.0) since actual ranking is done by RRF in hybrid.
- Fix RRF normalization: denominator calculation was correct but
  .min(1.0) was misleading. Replaced with explicit .clamp(0.0, 1.0).
- Replace memories.remove().unwrap() with expect() for clearer panic msg.

Metadata (from PR #262):
- Replace as_object_mut().unwrap() with if-let pattern to prevent panic.
- Server-mode remember now includes entity/category/meta in request body
  instead of silently ignoring them.

* style: cargo fmt
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.

feat: metadata enrichment — entity, category, and structured metadata via CLI flags

1 participant