[PR #345] Fix text nodes creation and improve agent handling #711

Open
opened 2026-02-16 00:18:52 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_cloud_services/pull/345
Author: @albertgilopez
Created: 8/11/2024
Status: 🔄 Open

Base: mainHead: fix-text-nodes-creation


📝 Commits (2)

  • 56119bd Improve multimodal report generation notebook
  • 2a45557 Fix text nodes creation, improve agent response handling, and update base agent setup

📊 Changes

2 files changed (+3669 additions, -472 deletions)

View changed files

📝 examples/multimodal/multimodal_rag_slide_deck.ipynb (+2355 -348)
📝 examples/multimodal/multimodal_report_generation.ipynb (+1314 -124)

📄 Description

This PR addresses several issues and improvements in the multimodal RAG pipeline:

  1. Text Nodes Creation:

    • Modified the get_text_nodes function to handle multiple documents and create a node for each page
    • Updated the code where text nodes are created to use the modified function
    • Added checks to print the number of nodes and content of specific nodes for verification
  2. Multimodal Query Engine:

    • Updated the MultimodalQueryEngine class to ensure it's properly returning source nodes
  3. Agent Setup and Response Handling:

    • Modified the setup for both multimodal and base agents to use ReActAgent.from_tools()
    • Updated the query process to use agent.chat() instead of agent.query()
    • Improved error handling when accessing source nodes in the response
  4. Consistency:

    • Ensured consistency between multimodal and base agent setups
    • Standardized the way queries are made and responses are handled for both agents

These changes ensure that:

  • We create a text node for each page in the document, matching the number of images
  • The query engine properly returns source nodes
  • Both multimodal and base agents are set up and queried consistently
  • Responses are handled safely, with proper checks for the existence of source nodes

Testing:

  • Verified that the number of text nodes matches the number of images
  • Tested queries on both multimodal and base agents to ensure they return expected results with source nodes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_cloud_services/pull/345 **Author:** [@albertgilopez](https://github.com/albertgilopez) **Created:** 8/11/2024 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-text-nodes-creation` --- ### 📝 Commits (2) - [`56119bd`](https://github.com/run-llama/llama_cloud_services/commit/56119bd4b0f3a15155a349f74cf48de4889d95ea) Improve multimodal report generation notebook - [`2a45557`](https://github.com/run-llama/llama_cloud_services/commit/2a45557361daafb76e9c521f3ac826dfb8212279) Fix text nodes creation, improve agent response handling, and update base agent setup ### 📊 Changes **2 files changed** (+3669 additions, -472 deletions) <details> <summary>View changed files</summary> 📝 `examples/multimodal/multimodal_rag_slide_deck.ipynb` (+2355 -348) 📝 `examples/multimodal/multimodal_report_generation.ipynb` (+1314 -124) </details> ### 📄 Description This PR addresses several issues and improvements in the multimodal RAG pipeline: 1. Text Nodes Creation: - Modified the `get_text_nodes` function to handle multiple documents and create a node for each page - Updated the code where text nodes are created to use the modified function - Added checks to print the number of nodes and content of specific nodes for verification 2. Multimodal Query Engine: - Updated the `MultimodalQueryEngine` class to ensure it's properly returning source nodes 3. Agent Setup and Response Handling: - Modified the setup for both multimodal and base agents to use `ReActAgent.from_tools()` - Updated the query process to use `agent.chat()` instead of `agent.query()` - Improved error handling when accessing source nodes in the response 4. Consistency: - Ensured consistency between multimodal and base agent setups - Standardized the way queries are made and responses are handled for both agents These changes ensure that: - We create a text node for each page in the document, matching the number of images - The query engine properly returns source nodes - Both multimodal and base agents are set up and queried consistently - Responses are handled safely, with proper checks for the existence of source nodes Testing: - Verified that the number of text nodes matches the number of images - Tested queries on both multimodal and base agents to ensure they return expected results with source nodes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 00:18:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#711