Skip to content

feat: Add hybrid-rrf-search bundle#196

Open
Yash-Hirani wants to merge 4 commits into
Lamatic:mainfrom
Yash-Hirani:main
Open

feat: Add hybrid-rrf-search bundle#196
Yash-Hirani wants to merge 4 commits into
Lamatic:mainfrom
Yash-Hirani:main

Conversation

@Yash-Hirani

@Yash-Hirani Yash-Hirani commented Jul 8, 2026

Copy link
Copy Markdown

PR Checklist

1. Select Contribution Type

  • Kit (kits/<category>/<kit-name>/)
  • Bundle (kits/<name>/) (Note: Using the new flattened kits/ structure per the latest CONTRIBUTING.md)
  • Template (templates/<template-name>/)

2. General Requirements

  • PR is for one project only (no unrelated changes)
  • No secrets, API keys, or real credentials are committed
  • Folder name uses kebab-case and matches the flow ID (kits/hybrid-rrf-search)
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure (Check what applies)

  • lamatic.config.ts present with valid metadata (name, description, tags, steps, author, env keys)
  • All flows in flows/ include:
    • Exported .ts flow structure
    • Externalized @prompts, @scripts, and @model-configs
  • .env.example with placeholder values only (kits only)
  • No hand‑edited flow node graphs (changes via Lamatic Studio export)

4. Validation

  • npm install && npm run dev works locally (kits: UI runs; bundles/templates: flows are valid)
  • PR title is clear (e.g., feat: Add hybrid-rrf-search bundle)
  • GitHub Actions workflows pass (all checks are green) (Will monitor after opening)
  • All CodeRabbit or other PR review comments are addressed and resolved (N/A yet)
  • No unrelated files or projects are modified
  • Added new kits/hybrid-rrf-search/ bundle (kebab-case; bundle step id hybrid-rrf-search in lamatic.config.ts).

  • Added files:

    • kits/hybrid-rrf-search/.env.example
    • kits/hybrid-rrf-search/README.md
    • kits/hybrid-rrf-search/agent.md
    • kits/hybrid-rrf-search/pitch.md
    • kits/hybrid-rrf-search/lamatic.config.ts
    • kits/hybrid-rrf-search/test_data/mars_base.txt
    • kits/hybrid-rrf-search/constitutions/default.md
    • kits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_system_0.md
    • 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
    • kits/hybrid-rrf-search/model-configs/hybrid-rrf-search_instructor-llmnode-687_generative-model-name.ts
    • kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts
  • Flow implementation (flows/hybrid-rrf-search.ts), node types + wiring:

    • triggerNode (API Request, graphqlNode) accepts query (string).
    • dynamicNode (Hybrid Search) runs hybrid retrieval using vectorDB: "hybridRRFRanking" with fusionType: "rankedFusion" and searchQuery sourced 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-level results array of { id, content, score }.
    • responseNode (API Response) returns { results: {{InstructorLLMNode_687.output.results}} }.
    • Edges: triggerNode_1 -> hybridSearchNode_957 -> InstructorLLMNode_687 -> responseNode_triggerNode_1.
  • High-level behavior:

    • Take the user query, perform hybrid BM25+vector search with ranked reciprocal-rank fusion, then use an LLM JSON-only reranker to produce the final top passages as a structured results array.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 304448c1-14b8-41fe-9e2b-a7b3a07c1f57

📥 Commits

Reviewing files that changed from the base of the PR and between 859bb50 and e4fd35a.

📒 Files selected for processing (2)
  • kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts
  • kits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_user_1.md

Walkthrough

This PR adds a new Lamatic kit for hybrid search with RRF fusion, LLM reranking, configuration wiring, and supporting documentation/assets.

Changes

Hybrid RRF Search Kit Addition

Layer / File(s) Summary
Flow definition: nodes, edges, and exports
kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts
Defines the flow metadata, inputs, references, node graph, edge wiring, and default export for the hybrid search pipeline.
Model configs and prompts for search/rerank nodes
kits/hybrid-rrf-search/model-configs/*, kits/hybrid-rrf-search/prompts/*
Adds the embedding and generative model configs plus the system/user prompts used by the search and reranking nodes.
Kit configuration, documentation, and test data
kits/hybrid-rrf-search/lamatic.config.ts, kits/hybrid-rrf-search/README.md, kits/hybrid-rrf-search/agent.md, kits/hybrid-rrf-search/pitch.md, kits/hybrid-rrf-search/constitutions/default.md, kits/hybrid-rrf-search/.env.example, kits/hybrid-rrf-search/test_data/mars_base.txt
Adds the bundle metadata, usage docs, constitution, env example, and sample test data.
Suggested reviewers: amanintech, d-pamneja
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the new hybrid-rrf-search bundle.
Description check ✅ Passed The checklist is mostly complete and covers the required sections, including type, requirements, file structure, and validation.
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 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.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Bundle: kits/hybrid-rrf-search

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Fix the heading spacing so markdownlint passes.

markdownlint-cli2 reports 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

📥 Commits

Reviewing files that changed from the base of the PR and between dafde4c and 2b4ac73.

📒 Files selected for processing (12)
  • kits/hybrid-rrf-search/.env.example
  • kits/hybrid-rrf-search/README.md
  • kits/hybrid-rrf-search/agent.md
  • kits/hybrid-rrf-search/constitutions/default.md
  • kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts
  • kits/hybrid-rrf-search/lamatic.config.ts
  • kits/hybrid-rrf-search/model-configs/hydrid-rrf-search_hybrid-search-node-957_embedding-model-name.ts
  • kits/hybrid-rrf-search/model-configs/hydrid-rrf-search_instructor-llmnode-687_generative-model-name.ts
  • kits/hybrid-rrf-search/pitch.md
  • kits/hybrid-rrf-search/prompts/hydrid-rrf-search_instructor-llmnode-687_system_0.md
  • kits/hybrid-rrf-search/prompts/hydrid-rrf-search_instructor-llmnode-687_user_1.md
  • kits/hybrid-rrf-search/test_data/mars_base.txt

Comment thread kits/hybrid-rrf-search/agent.md
Comment thread kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts Outdated
Comment thread kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts Outdated
Comment thread kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts Outdated
Comment thread kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts
Comment on lines +1 to +2
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ 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.

Suggested change
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2b4ac73 and 859bb50.

📒 Files selected for processing (7)
  • kits/hybrid-rrf-search/agent.md
  • kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts
  • kits/hybrid-rrf-search/model-configs/hybrid-rrf-search_hybrid-search-node-957_embedding-model-name.ts
  • kits/hybrid-rrf-search/model-configs/hybrid-rrf-search_instructor-llmnode-687_generative-model-name.ts
  • kits/hybrid-rrf-search/pitch.md
  • kits/hybrid-rrf-search/prompts/hybrid-rrf-search_instructor-llmnode-687_system_0.md
  • kits/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

Comment thread kits/hybrid-rrf-search/flows/hybrid-rrf-search.ts Outdated
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

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.

1 participant