Skip to content

docs: add usage example for retrieval_core #20#39

Merged
Aaryan-Dadu merged 3 commits into
iiitl:devfrom
Sreyash308:docs-retrieval-usage
Apr 12, 2026
Merged

docs: add usage example for retrieval_core #20#39
Aaryan-Dadu merged 3 commits into
iiitl:devfrom
Sreyash308:docs-retrieval-usage

Conversation

@Sreyash308
Copy link
Copy Markdown

@Sreyash308 Sreyash308 commented Apr 11, 2026

Description
This PR adds a usage example for the retrieval_core task as requested in #20. It includes a Python code snippet, input/output structures, and documentation on the task's probabilistic nature.

Changes
Added docs/usage/retrieval_core.md

Included example script and data formats.

Screenshots
Screenshot 2026-04-12 at 2 01 48 AM

Closes #20

Summary by CodeRabbit

  • Documentation
    • Added a user guide for the retrieval_core probabilistic task, including a practical Python example demonstrating how to run the task on sample data.
    • Includes sample output and guidance on interpreting key result fields — confidence, query hits, and top term — to aid document indexing and query estimation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8706494c-13c7-4d1f-85b5-fecdb5848723

📥 Commits

Reviewing files that changed from the base of the PR and between 36f6137 and 260355c.

📒 Files selected for processing (1)
  • docs/usage/retrieval_core.md
✅ Files skipped from review due to trivial changes (1)
  • docs/usage/retrieval_core.md

Walkthrough

Adds docs/usage/retrieval_core.md, a usage doc for the retrieval_core probabilistic task with a Python example that imports solve and generate, builds a sample payload, runs the solver, and prints confidence, query_hits, and top_term.

Changes

Cohort / File(s) Summary
Documentation
docs/usage/retrieval_core.md
New usage page describing the retrieval_core task. Includes a Python example that imports solve and generate from chuck.tasks.retrieval_core.task, calls generate(count=100, seed=42), invokes solve(payload), and prints results['confidence'], results['query_hits'], and results['top_term']. File created without a trailing newline.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

documentation

🚥 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 directly describes the main change: adding a usage example documentation for retrieval_core, which aligns with the changeset.
Linked Issues check ✅ Passed The PR fulfills all coding requirements from issue #20: creates /docs/usage/retrieval_core.md with example script, input/output structures, and documentation.
Out of Scope Changes check ✅ Passed The single file change (docs/usage/retrieval_core.md) is directly scoped to issue #20 requirements for retrieval_core usage documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/usage/retrieval_core.md (1)

7-24: ⚠️ Potential issue | 🟡 Minor

Fix the Markdown code fence delimiter mismatch.

The block starts with three backticks at Line 7 and closes with four at Line 24, which can break rendering.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/usage/retrieval_core.md` around lines 7 - 24, The Markdown code block in
the example usage for RetrievalCore has a mismatched fence (starts with ``` but
ends with ````); fix the closing fence to exactly three backticks so the snippet
for RetrievalCore and task.solve renders correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/usage/retrieval_core.md`:
- Around line 8-23: Update the example to match the real RetrievalCore API:
replace the incorrect import with the actual module import for RetrievalCore,
replace the call to task.solve(...) with the real runner method used by
RetrievalCore (e.g., task.run(...) or task.execute(...)) and adjust result
access to the actual return structure (do not use result['matches'] or
result['confidence']; instead index into the returned results list/dict — e.g.,
result['results'][0]['id'] and the corresponding score field such as
result['results'][0]['score'] or result['results'][0]['confidence'] depending on
the actual keys). Locate and update the lines referencing RetrievalCore, solve,
matches, and confidence in the snippet.

---

Outside diff comments:
In `@docs/usage/retrieval_core.md`:
- Around line 7-24: The Markdown code block in the example usage for
RetrievalCore has a mismatched fence (starts with ``` but ends with ````); fix
the closing fence to exactly three backticks so the snippet for RetrievalCore
and task.solve renders correctly.
🪄 Autofix (Beta)

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

Run ID: 9350592b-69fa-4da5-9af7-652103acac3b

📥 Commits

Reviewing files that changed from the base of the PR and between a302e5f and 4ff78c6.

📒 Files selected for processing (1)
  • docs/usage/retrieval_core.md

Comment thread docs/usage/retrieval_core.md Outdated
Comment thread docs/usage/retrieval_core.md
Comment thread docs/usage/retrieval_core.md
@Sreyash308 Sreyash308 force-pushed the docs-retrieval-usage branch from 4ff78c6 to ec16a13 Compare April 11, 2026 20:22
@Sreyash308 Sreyash308 requested a review from Aaryan-Dadu April 11, 2026 20:32
@Aaryan-Dadu
Copy link
Copy Markdown
Member

Please don't resolve conversation as it the maintainer are supposed to mark them as resolved if they are satisfied.
Another note is to please avoid rebase and force push in PR unless mentioned or is needed because it makes navigation in the commit history difficult for the maintainers.

@Aaryan-Dadu
Copy link
Copy Markdown
Member

Please mention the output in the file too. And the CI checks are failing please resolve them.

@Aaryan-Dadu
Copy link
Copy Markdown
Member

This is strange, in the screenshot in your PR description I can see that you ran the command but activated the virtual environment later. I doubt the correctness of the output generated, please look into it.

@Sreyash308
Copy link
Copy Markdown
Author

Sreyash308 commented Apr 12, 2026

This is strange, in the screenshot in your PR description I can see that you ran the command but activated the virtual environment later. I doubt the correctness of the output generated, please look into it.

Screenshot 2026-04-12 at 11 41 37 AM

Sorry @Aaryan-Dadu , it was because i did'nt run the file using vnev terminal , i ran the file on dedicated teminal without checking on to it. I resolved it by running in Virtual Environment.

@Aaryan-Dadu
Copy link
Copy Markdown
Member

Thanks for the PR! Looks good to me

@Aaryan-Dadu
Copy link
Copy Markdown
Member

Just one last thing, the CI checks are failing please resolve them

@Aaryan-Dadu
Copy link
Copy Markdown
Member

Looks Good! Thanks

@Aaryan-Dadu Aaryan-Dadu changed the base branch from main to dev April 12, 2026 07:25
@Aaryan-Dadu Aaryan-Dadu merged commit c0628ce into iiitl:dev Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Examples / Usage docs for retrieval_core

2 participants