dynamic_section_retrieval.ipynb example not running #346

Closed
opened 2026-02-16 00:17:35 -05:00 by yindo · 4 comments
Owner

Originally created by @nsanghi on GitHub (Nov 22, 2024).

Describe the bug
While running ./examples/advanced_rag/dynamic_section_retrieval.ipynb, specifically

nodes = section_retrieve(
    "Give me a full overview of the benchmark details in SWE Bench", verbose=True
)

I am getting an error in function call in the line section_nodes_raw = index.vector_store.get_nodes(node_ids=None, filters=filters) which says the following

/python3.11/site-packages/chromadb/api/types.py:498, in validate_ids(ids)
/python3.11/site-packages/chromadb/api/types.py:497) if len(ids) == 0:
/lib/python3.11/site-packages/chromadb/api/types.py:498)     raise ValueError(f"Expected IDs to be a non-empty list, got {len(ids)} IDs")
    
ValueError: Expected IDs to be a non-empty list, got 0 IDs

Looks like we need to pass a full list of nodes but I am not sure how to get it. In this notebook I can get it like so

[n.id_ for n in all_text_nodes]

but in a real enviroment all_text_nodes will not be available and I do not know how to retreive all nodes from an index.

BTW - the idea of dynamic section is a very neal one and very helpful to my use use.

Client:

  • Notebook
Originally created by @nsanghi on GitHub (Nov 22, 2024). **Describe the bug** While running `./examples/advanced_rag/dynamic_section_retrieval.ipynb`, specifically ```python nodes = section_retrieve( "Give me a full overview of the benchmark details in SWE Bench", verbose=True ) ``` I am getting an error in function call in the line ` section_nodes_raw = index.vector_store.get_nodes(node_ids=None, filters=filters)` which says the following ``` /python3.11/site-packages/chromadb/api/types.py:498, in validate_ids(ids) /python3.11/site-packages/chromadb/api/types.py:497) if len(ids) == 0: /lib/python3.11/site-packages/chromadb/api/types.py:498) raise ValueError(f"Expected IDs to be a non-empty list, got {len(ids)} IDs") ValueError: Expected IDs to be a non-empty list, got 0 IDs ``` Looks like we need to pass a full list of nodes but I am not sure how to get it. In this notebook I can get it like so `[n.id_ for n in all_text_nodes]` but in a real enviroment `all_text_nodes` will not be available and I do not know how to retreive all nodes from an index. BTW - the idea of dynamic section is a very neal one and very helpful to my use use. **Client:** - Notebook
yindo added the bug label 2026-02-16 00:17:35 -05:00
yindo closed this issue 2026-02-16 00:17:35 -05:00
Author
Owner

@nsanghi commented on GitHub (Nov 22, 2024):

Solved by using this modification. CLosing the issue and leaving this comment for others

in section_retrieve function replace

 section_nodes_raw = index.vector_store.get_nodes(node_ids=None, filters=filters)

with

all_ids = index.vector_store._collection.get()['ids']
section_nodes_raw = index.vector_store.get_nodes(node_ids=all_ids, filters=filters)
@nsanghi commented on GitHub (Nov 22, 2024): Solved by using this modification. CLosing the issue and leaving this comment for others in `section_retrieve` function replace ```python section_nodes_raw = index.vector_store.get_nodes(node_ids=None, filters=filters) ``` with ```python all_ids = index.vector_store._collection.get()['ids'] section_nodes_raw = index.vector_store.get_nodes(node_ids=all_ids, filters=filters) ```
Author
Owner

@nsanghi commented on GitHub (Nov 22, 2024):

The notebook needs a modification.
in section_retrieve function replace

 section_nodes_raw = index.vector_store.get_nodes(node_ids=None, filters=filters)

with

all_ids = index.vector_store._collection.get()['ids']
section_nodes_raw = index.vector_store.get_nodes(node_ids=all_ids, filters=filters)
@nsanghi commented on GitHub (Nov 22, 2024): The notebook needs a modification. in `section_retrieve` function replace ```python section_nodes_raw = index.vector_store.get_nodes(node_ids=None, filters=filters) ``` with ```python all_ids = index.vector_store._collection.get()['ids'] section_nodes_raw = index.vector_store.get_nodes(node_ids=all_ids, filters=filters) ```
Author
Owner

@Rit2712 commented on GitHub (Nov 28, 2024):

Hii @nsanghi .... Does this notebook work for open-source models?

@Rit2712 commented on GitHub (Nov 28, 2024): Hii @nsanghi .... Does this notebook work for open-source models?
Author
Owner

@nsanghi commented on GitHub (Nov 28, 2024):

@Rit2712 - I have not tried it beyond using openAI models. But the best part of this notebook is not the LLM but the innovative way chunking is done with enhacned meta data making it easier to do retrieval

@nsanghi commented on GitHub (Nov 28, 2024): @Rit2712 - I have not tried it beyond using openAI models. But the best part of this notebook is not the LLM but the innovative way chunking is done with enhacned meta data making it easier to do retrieval
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#346