feat: Add hybrid-rrf-search bundle#196
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR adds a new Lamatic kit for hybrid search with RRF fusion, LLM reranking, configuration wiring, and supporting documentation/assets. ChangesHybrid RRF Search Kit Addition
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
:robot_face: AgentKit Structural ValidationNew Contributions Detected
Check Results
🎉 All checks passed! This contribution follows the AgentKit structure. |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
kits/hybrid-rrf-search/pitch.md (1)
1-21: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winFix the heading spacing so markdownlint passes.
markdownlint-cli2reports MD022 at Lines 3, 9, 13, and 18. Add the missing blank lines around those headings before merging.🤖 Prompt for 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. In `@kits/hybrid-rrf-search/pitch.md` around lines 1 - 21, The pitch markdown has heading spacing that violates markdownlint MD022, so update the Markdown in pitch.md to add the missing blank lines around the headings that appear in the Hybrid RRF Search Bundle section. Keep the content unchanged and adjust the spacing around the top-level and subsection headings so markdownlint-cli2 passes.Source: Linters/SAST tools
🤖 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 `@kits/hybrid-rrf-search/agent.md`:
- Around line 17-20: The output contract in the guardrails is inconsistent with
the flow schema: the agent is told to emit only a JSON array, but the downstream
flow expects a JSON object with a top-level results field. Update the
instructions in agent.md so the model produces the object shape required by the
response node, and make sure the wording around the structured output contract
matches the flow/README expectations for the reranker.
In `@kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts`:
- Around line 134-145: The InstructorLLMNode_687 prompt and schema are
inconsistent: the schema in hybrid-rrf-search.ts expects a top-level object with
a results array, but the system prompt tells the model to return a bare JSON
array. Update the system prompt referenced by InstructorLLMNode_687 so it
explicitly asks for a JSON object containing a results key that wraps the array,
keeping the prompt aligned with the declared schema.
- Around line 35-45: The reference keys and associated asset names in
hybrid-rrf-search still use the misspelling "hydrid" instead of "hybrid", which
hurts discoverability and polish. Update the affected identifiers in the flow
config and related references under hybrid-rrf-search so they consistently use
the corrected "hybrid" spelling, including the prompt, modelConfigs, and scripts
entries, while keeping the wiring intact via the same symbols in
hybrid-rrf-search.ts.
- Line 99: The `vectorDB` value in `hybridRRFSearch` looks misspelled and may
not match the actual Weaviate collection name. Update the string used for the
`vectorDB` field in `hybrid-rrf-search.ts` to the correct collection name
(likely `hybridRRFRanking` or the exact registered name) so the hybrid search
flow can resolve it reliably.
- Around line 42-45: The hybridRrfSearch flow references two script assets that
are missing, so codeNode_861 and codeNode_933 cannot load at runtime. Add the
missing script files under the expected `@scripts` paths used by hybridRrfSearch,
and make sure the script keys in the flow definition still point to those assets
so both code nodes can resolve successfully.
In
`@kits/hybrid-rrf-search/prompts/hydrid-rrf-search_instructor-llmnode-687_system_0.md`:
- Around line 1-2: The system prompt for InstructorLLMNode_687 currently tells
the model to return a bare JSON array, but the node schema expects a wrapped
object with a results field. Update the prompt text in the hybrid rrf search
instructor system prompt to explicitly require a JSON object shaped like {
"results": [...] } and keep the “top 5 most relevant passages” instruction
aligned with that wrapper so the prompt matches the schema.
---
Outside diff comments:
In `@kits/hybrid-rrf-search/pitch.md`:
- Around line 1-21: The pitch markdown has heading spacing that violates
markdownlint MD022, so update the Markdown in pitch.md to add the missing blank
lines around the headings that appear in the Hybrid RRF Search Bundle section.
Keep the content unchanged and adjust the spacing around the top-level and
subsection headings so markdownlint-cli2 passes.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: d3f2155f-3c8d-4d73-81d7-5c29e07c0a46
📒 Files selected for processing (12)
kits/hybrid-rrf-search/.env.examplekits/hybrid-rrf-search/README.mdkits/hybrid-rrf-search/agent.mdkits/hybrid-rrf-search/constitutions/default.mdkits/hybrid-rrf-search/flows/hybrid-rrf-search.tskits/hybrid-rrf-search/lamatic.config.tskits/hybrid-rrf-search/model-configs/hydrid-rrf-search_hybrid-search-node-957_embedding-model-name.tskits/hybrid-rrf-search/model-configs/hydrid-rrf-search_instructor-llmnode-687_generative-model-name.tskits/hybrid-rrf-search/pitch.mdkits/hybrid-rrf-search/prompts/hydrid-rrf-search_instructor-llmnode-687_system_0.mdkits/hybrid-rrf-search/prompts/hydrid-rrf-search_instructor-llmnode-687_user_1.mdkits/hybrid-rrf-search/test_data/mars_base.txt
| You are an expert relevance-scoring AI. You will be provided with a user's search query and a JSON array of retrieved passages. Your job is to evaluate how relevant each passage is to the query on a scale of 0.0 to 1.0. | ||
| You must return a JSON array containing ONLY the top 5 most relevant passages, sorted from highest score to lowest. No newline at end of file |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
System prompt instructs bare array return, but the node schema expects a wrapped object.
This is the root cause of the prompt-schema mismatch flagged in the flow file. The prompt says "return a JSON array," but InstructorLLMNode_687's schema expects {"results": [...]}. Update the prompt to instruct the model to return an object with a results key containing the array.
🔧 Proposed fix
You are an expert relevance-scoring AI. You will be provided with a user's search query and a JSON array of retrieved passages. Your job is to evaluate how relevant each passage is to the query on a scale of 0.0 to 1.0.
-You must return a JSON array containing ONLY the top 5 most relevant passages, sorted from highest score to lowest.
+You must return a JSON object with a "results" key containing an array of ONLY the top 5 most relevant passages, sorted from highest score to lowest. Each passage object must include "id", "content", and "score" fields.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| You are an expert relevance-scoring AI. You will be provided with a user's search query and a JSON array of retrieved passages. Your job is to evaluate how relevant each passage is to the query on a scale of 0.0 to 1.0. | |
| You must return a JSON array containing ONLY the top 5 most relevant passages, sorted from highest score to lowest. | |
| You are an expert relevance-scoring AI. You will be provided with a user's search query and a JSON array of retrieved passages. Your job is to evaluate how relevant each passage is to the query on a scale of 0.0 to 1.0. | |
| You must return a JSON object with a "results" key containing an array of ONLY the top 5 most relevant passages, sorted from highest score to lowest. Each passage object must include "id", "content", and "score" fields. |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
[warning] 2-2: Files should end with a single newline character
(MD047, single-trailing-newline)
🤖 Prompt for 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.
In
`@kits/hybrid-rrf-search/prompts/hydrid-rrf-search_instructor-llmnode-687_system_0.md`
around lines 1 - 2, The system prompt for InstructorLLMNode_687 currently tells
the model to return a bare JSON array, but the node schema expects a wrapped
object with a results field. Update the prompt text in the hybrid rrf search
instructor system prompt to explicitly require a JSON object shaped like {
"results": [...] } and keep the “top 5 most relevant passages” instruction
aligned with that wrapper so the prompt matches the schema.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts`:
- Line 78: The hybrid-rrf-search flow still points to missing script asset
references, so update the flow definition in hybrid-rrf-search.ts to use only
script nodes that actually exist in the kit. Check the broken script node
entries for `@scripts/hybrid-rrf-search_code-node-861_code.ts` and
`@scripts/hybrid-rrf-search_code-node-933_code.ts`, and either restore the
matching assets or replace those references with the correct existing script
files while leaving the model config and user prompt entries unchanged.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: db6cbe1e-f6fd-46f9-ae16-1a2a43b36a88
📒 Files selected for processing (7)
kits/hybrid-rrf-search/agent.mdkits/hybrid-rrf-search/flows/hybrid-rrf-search.tskits/hybrid-rrf-search/model-configs/hybrid-rrf-search_hybrid-search-node-957_embedding-model-name.tskits/hybrid-rrf-search/model-configs/hybrid-rrf-search_instructor-llmnode-687_generative-model-name.tskits/hybrid-rrf-search/pitch.mdkits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_system_0.mdkits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_user_1.md
💤 Files with no reviewable changes (2)
- kits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_user_1.md
- kits/hybrid-rrf-search/model-configs/hybrid-rrf-search_hybrid-search-node-957_embedding-model-name.ts
|
Hi @Yash-Hirani! 👋 Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review. Steps to follow:
This helps keep the review process efficient for everyone. Thank you! 🙏 |
PR Checklist
1. Select Contribution Type
kits/<category>/<kit-name>/)kits/<name>/) (Note: Using the new flattenedkits/structure per the latest CONTRIBUTING.md)templates/<template-name>/)2. General Requirements
kebab-caseand matches the flow ID (kits/hybrid-rrf-search)README.md(purpose, setup, usage)3. File Structure (Check what applies)
lamatic.config.tspresent with valid metadata (name, description, tags, steps, author, env keys)flows/include:.tsflow structure@prompts,@scripts, and@model-configs.env.examplewith placeholder values only (kits only)4. Validation
npm install && npm run devworks locally (kits: UI runs; bundles/templates: flows are valid)feat: Add hybrid-rrf-search bundle)Added new
kits/hybrid-rrf-search/bundle (kebab-case; bundle step idhybrid-rrf-searchinlamatic.config.ts).Added files:
kits/hybrid-rrf-search/.env.examplekits/hybrid-rrf-search/README.mdkits/hybrid-rrf-search/agent.mdkits/hybrid-rrf-search/pitch.mdkits/hybrid-rrf-search/lamatic.config.tskits/hybrid-rrf-search/test_data/mars_base.txtkits/hybrid-rrf-search/constitutions/default.mdkits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_system_0.mdkits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_user_1.mdkits/hybrid-rrf-search/model-configs/hybrid-rrf-search_hybrid-search-node-957_embedding-model-name.tskits/hybrid-rrf-search/model-configs/hybrid-rrf-search_instructor-llmnode-687_generative-model-name.tskits/hybrid-rrf-search/flows/hybrid-rrf-search.tsFlow implementation (
flows/hybrid-rrf-search.ts), node types + wiring:triggerNode(API Request,graphqlNode) acceptsquery(string).dynamicNode(Hybrid Search) runs hybrid retrieval usingvectorDB: "hybridRRFRanking"withfusionType: "rankedFusion"andsearchQuerysourced from the trigger output.dynamicNode(InstructorLLMNode, node name:Generate JSON) reranks the retrieved passages and is constrained by an output JSON schema requiring a top-levelresultsarray of{ id, content, score }.responseNode(API Response) returns{ results: {{InstructorLLMNode_687.output.results}} }.triggerNode_1 -> hybridSearchNode_957 -> InstructorLLMNode_687 -> responseNode_triggerNode_1.High-level behavior:
resultsarray.