-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: How can i get all nodes from the PGVectorDB? #13363
Comments
To retrieve all nodes from your PGVectorDB for use with a BM25 Retriever, ensure your document store ( Here's how you can initialize the from llama_index.retrievers.bm25.base import BM25Retriever
from llama_index.vector_stores.postgres import PGVectorStore
# Assuming you have a PGVectorStore instance
vector_store = PGVectorStore.from_params(
database="vector_db",
host="localhost",
password="password",
port=5432,
user="postgres",
table_name="your_table_name",
embed_dim=1536 # Dimension of your embeddings
)
# Initialize BM25Retriever with the document store
bm25_retriever = BM25Retriever.from_defaults(docstore=vector_store, tokenizer=None, verbose=True) Make sure your PGVectorDB instance or wrapper correctly implements the
|
@doganaktarr 请问您这个问题解决了吗 ,我在使用ES数据库的时候也遇到这个问题,nodes: dict_values([]) , |
Question Validation
Question
Hi, I have stored a collection of nodes in a PGVector DB, I'd like to be able to retrieve all the nodes to retrieve docs with BM25 Retriever. I don't want to read the document every time i want to retrieve with bm25.
I've already tried to get it with:
nodes: dict_values([])
It returns an empty dict even it has a value in the table.
The text was updated successfully, but these errors were encountered: