Skip to content

Improve haystack_deep_research_agent example#1170

Merged
rapids-bot[bot] merged 2 commits intoNVIDIA:developfrom
deepset-ai:haystack-example-improvement
Nov 13, 2025
Merged

Improve haystack_deep_research_agent example#1170
rapids-bot[bot] merged 2 commits intoNVIDIA:developfrom
deepset-ai:haystack-example-improvement

Conversation

@mpangrazzi
Copy link
Contributor

@mpangrazzi mpangrazzi commented Nov 7, 2025

This improves the Haystack Deep Research Agent example:

  • Updates the RAG / Agent LLM model to nvidia/llama-3.3-nemotron-super-49b-v1.5
  • Use embedding-based retrieval and document indexing replacing OpenSearchBM25Retriever with OpenSearchEmbeddingRetriever and NvidiaDocumentEmbedder Haystack components, improving search relevance and enabling actual semantic search. The main changes include switching to embedding models for both document indexing and retrieval Haystack pipelines, updating configuration to support embedding parameters, and refactoring pipelines to integrate embedding components.

(retry of #1161)

Summary by CodeRabbit

  • New Features

    • Integrated NVIDIA embedders for document indexing and query embedding; retrieval now uses embedding-based matching.
  • Updates

    • Language model identifiers updated to v1.5.
    • Configuration now requires an embedder model name and embedding_dim (1024 by default).
    • Startup indexing and retrieval flows updated to require and propagate the embedder selection.
  • Tests

    • Config validation updated to assert presence of embedding_dim.

@mpangrazzi mpangrazzi requested a review from a team as a code owner November 7, 2025 22:49
@copy-pr-bot
Copy link

copy-pr-bot bot commented Nov 7, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

Integrates NVIDIA embedders into the Haystack deep research agent: configuration adds nv-embed and embedding_dim: 1024, model IDs updated to v1.5, indexing and RAG pipelines now use NvidiaDocumentEmbedder/NvidiaTextEmbedder, and function signatures are updated to accept an embedder_model parameter.

Changes

Cohort / File(s) Summary
Configuration
examples/frameworks/haystack_deep_research_agent/src/nat_haystack_deep_research_agent/configs/config.yml
Updated rag_llm and agent_llm model IDs from v1 → v1.5; added nv-embed embedder (type: nim, model: nvidia/nv-embedqa-e5-v5); added workflow-level embedder_name: nv-embed and embedding_dim: 1024.
Indexing Pipeline
examples/frameworks/haystack_deep_research_agent/src/nat_haystack_deep_research_agent/pipelines/indexing.py
Added NvidiaDocumentEmbedder step; _build_indexing_pipeline now accepts embedder_model: str; run_startup_indexing requires keyword-only embedder_model and validates it; pipeline flow changed to include embedder before writer.
RAG Pipeline
examples/frameworks/haystack_deep_research_agent/src/nat_haystack_deep_research_agent/pipelines/rag.py
Switched from OpenSearchBM25RetrieverOpenSearchEmbeddingRetriever; added NvidiaTextEmbedder query step; create_rag_tool now requires embedder_model and wires query_embedder.embeddingretriever.query_embedding.
Framework Registration
examples/frameworks/haystack_deep_research_agent/src/nat_haystack_deep_research_agent/register.py
Added embedder_name: EmbedderRef = "nv-embed" and embedding_dim: int = 1024 to HaystackDeepResearchWorkflowConfig; imported EmbedderRef; threaded embedder_model through document store initialization, startup indexing, and RAG tool creation.
Tests
examples/frameworks/haystack_deep_research_agent/tests/test_haystack_deep_research_agent.py
Test updated to require new embedding_dim YAML config key in config validation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Indexer as Indexing Pipeline
    participant RAG as RAG Pipeline
    participant Store as Document Store
    participant LLM

    rect rgb(245, 250, 255)
    Note over Indexer: Indexing flow (new)
    User->>Indexer: submit PDFs + embedder_model
    Indexer->>Indexer: pdf_converter → cleaner → splitter
    Indexer->>Indexer: NvidiaDocumentEmbedder (embed PDFs)
    Indexer->>Store: write documents (with embeddings)
    end

    rect rgb(245, 255, 245)
    Note over RAG: RAG query flow (new)
    User->>RAG: query + embedder_model
    RAG->>RAG: NvidiaTextEmbedder (query → embedding)
    RAG->>RAG: OpenSearchEmbeddingRetriever (use query embedding)
    RAG->>Store: retrieve relevant docs
    RAG->>RAG: prompt_builder → LLM call
    RAG->>User: response
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas needing extra attention:
    • Call-site and API compatibility for updated function signatures (_build_indexing_pipeline, run_startup_indexing, create_rag_tool) across the codebase.
    • Correct wiring of embedder outputs to retriever inputs and document writer inputs.
    • Document store initialization with embedding_dim and compatibility with OpenSearchEmbeddingRetriever.
    • Imports and availability of NvidiaDocumentEmbedder, NvidiaTextEmbedder, and related integration components.

Suggested labels

duplicate

Pre-merge checks and finishing touches

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Improve haystack_deep_research_agent example' is vague and generic, using non-descriptive terms that don't clearly convey the main technical changes (embedding model upgrades and retriever replacement). Revise the title to be more specific about the key changes, such as 'Add embedding-based retrieval to haystack_deep_research_agent example' or 'Update haystack example with NvidiaEmbedder components'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9683d71 and 7403c75.

📒 Files selected for processing (1)
  • examples/frameworks/haystack_deep_research_agent/tests/test_haystack_deep_research_agent.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/frameworks/haystack_deep_research_agent/tests/test_haystack_deep_research_agent.py

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.

… NvidiaDocumentEmbedder ; Update tests ; Refactoring

Signed-off-by: Michele Pangrazzi <xmikex83@gmail.com>
@mpangrazzi mpangrazzi force-pushed the haystack-example-improvement branch from b360922 to 9683d71 Compare November 7, 2025 22:50
@coderabbitai coderabbitai bot added the duplicate This issue or pull request already exists label Nov 7, 2025
@willkill07 willkill07 added improvement Improvement to existing functionality non-breaking Non-breaking change and removed duplicate This issue or pull request already exists labels Nov 10, 2025
@willkill07
Copy link
Member

/ok to test 9683d71

Signed-off-by: Michele Pangrazzi <xmikex83@gmail.com>
@coderabbitai coderabbitai bot added the duplicate This issue or pull request already exists label Nov 10, 2025
@willkill07
Copy link
Member

/ok to test 7403c75

@willkill07 willkill07 removed the duplicate This issue or pull request already exists label Nov 10, 2025
@willkill07
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit 164b873 into NVIDIA:develop Nov 13, 2025
17 checks passed
@mpangrazzi mpangrazzi deleted the haystack-example-improvement branch November 14, 2025 09:15
saglave pushed a commit to snps-scm13/SNPS-NeMo-Agent-Toolkit that referenced this pull request Dec 11, 2025
This improves the Haystack Deep Research Agent example:

- Updates the RAG / Agent LLM model to `nvidia/llama-3.3-nemotron-super-49b-v1.5`
- Use embedding-based retrieval and document indexing replacing `OpenSearchBM25Retriever` with `OpenSearchEmbeddingRetriever` and `NvidiaDocumentEmbedder` Haystack components, improving search relevance and enabling actual semantic search. The main changes include switching to embedding models for both document indexing and retrieval Haystack pipelines, updating configuration to support embedding parameters, and refactoring pipelines to integrate embedding components.

(retry of NVIDIA#1161)

## Summary by CodeRabbit

* **New Features**
  * Integrated NVIDIA embedders for document indexing and query embedding; retrieval now uses embedding-based matching.

* **Updates**
  * Language model identifiers updated to v1.5.
  * Configuration now requires an embedder model name and embedding_dim (1024 by default).
  * Startup indexing and retrieval flows updated to require and propagate the embedder selection.

* **Tests**
  * Config validation updated to assert presence of embedding_dim.

Authors:
  - Michele Pangrazzi (https://github.com/mpangrazzi)

Approvers:
  - Will Killian (https://github.com/willkill07)

URL: NVIDIA#1170
Signed-off-by: Sangharsh Aglave <aglave@synopsys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement to existing functionality non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants