Skip to content

feat(module): expose query-less document recall - #12

Merged
senamakel merged 2 commits into
mainfrom
fix/module-document-recall
Aug 13, 2026
Merged

feat(module): expose query-less document recall#12
senamakel merged 2 commits into
mainfrom
fix/module-document-recall

Conversation

@senamakel

@senamakel senamakel commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • extend the shared MemoryDocuments contract with query-less recall
  • route the module provider to TinyMemory’s native recall operation
  • publish the operation over TinyBus with response-size enforcement

Why

An empty ranked query does not preserve the semantics or rendered context of query-less namespace recall. OpenHuman needs this method to finish moving its document RPC boundary onto the compiled TinyMemory module.

Verification

  • cargo check --all-features --manifest-path Cargo.toml
  • cargo check --all-features --manifest-path crates/tinymemory-module/Cargo.toml
  • cargo fmt --all -- --check

Summary by CodeRabbit

  • New Features
    • Added document recall functionality for retrieving the highest-ranked context within a namespace.
    • Supports configurable result limits and ranking based on freshness and priority.
    • Returns an empty context for namespaces without documents.
    • Clearly reports when document recall is unsupported or encounters an error.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@senamakel, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 112 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b697b0f2-cef8-4a57-b451-1e08d71100f7

📥 Commits

Reviewing files that changed from the base of the PR and between b193e18 and c5796a2.

📒 Files selected for processing (1)
  • api/src/provider/content.rs
📝 Walkthrough

Walkthrough

The PR adds query-less namespace document recall to MemoryDocuments, implements it in the TinyMemory provider, exposes it through MemoryService, and defines unsupported behavior for NullMemoryProvider.

Changes

Document recall

Layer / File(s) Summary
Recall contract and unsupported provider
api/src/provider/content.rs, api/src/null.rs
MemoryDocuments now defines recall_documents for ranked namespace retrieval with a limit. Empty namespaces return empty context. NullMemoryProvider returns an unsupported Documents error.
Provider and service integration
crates/tinymemory-module/src/provider.rs, crates/tinymemory-module/src/service/mod.rs
The TinyMemory provider clamps the limit to u32, maps client errors, and converts results. MemoryService forwards requests, maps provider errors, and enforces the response-size budget.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: 🔵 Low · up to b193e

The PR adds query-less document recall to the shared API and exposes it through TinyBus. It is mergeable with owner awareness: the public trait change needs a compatibility/release decision, and caller-controlled limits should be confirmed safe for any untrusted access.

Possibly related PRs

Poem

A rabbit recalls through namespaces wide,
With ranked little notes in a bounded stride.
The bus carries context, errors stay clear,
Empty halls return silence, not fear.
Tiny paws approve this document cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: exposing query-less document recall through the module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/src/provider/content.rs`:
- Around line 147-150: Update the recall_documents documentation’s # Errors
section to include MemoryError::Unsupported when the Documents capability is
unavailable, or explicitly scope backend-failure handling to after capability
negotiation. Keep the existing empty-namespace behavior documented.
- Around line 140-154: Update the MemoryDocuments::recall_documents trait method
to provide a default implementation so existing external implementors remain
source-compatible, unless the release is explicitly treated as a pre-1.0 minor
breaking release. Extend its # Errors documentation to include
MemoryError::Unsupported, matching NullMemoryProvider’s behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 24939186-4fff-43b7-a0e5-2a2654619d36

📥 Commits

Reviewing files that changed from the base of the PR and between 54c2c82 and b193e18.

📒 Files selected for processing (4)
  • api/src/null.rs
  • api/src/provider/content.rs
  • crates/tinymemory-module/src/provider.rs
  • crates/tinymemory-module/src/service/mod.rs

Comment thread api/src/provider/content.rs Outdated
Comment thread api/src/provider/content.rs
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 3660ce1 into main Aug 13, 2026
11 checks passed
@senamakel
senamakel deleted the fix/module-document-recall branch August 13, 2026 03:33
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