Find answers from the community

s
F
Y
a
P
Updated 6 months ago

I'm using pgvector as vector store.

I'm using pgvector as vector store. Given a node id, I used to get it as follows: index.docstore.get_node('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'), however I noticed it does not work anymore (I checked carefully the id and it exist in the db indeed). Did something change?
Error:
Plain Text
server  |   File "/usr/local/lib/python3.11/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 279, in get_document
server  |     raise ValueError(f"doc_id {doc_id} not found.")
L
p
3 comments
the docstore is not populated (by default) when using most vector db integrations
@Logan M I guess this is where I'm missing something. I use pgvector integration, which creates tables with columns: id, text, metadata_, node_id and embedding. text contains indeed the text that got embedded. The column node_id contains the uuids. Do you mean that I should manually create another entity (a docstore) at runtime to get this data from the DB?
I'm saying you should just query your table with sqlalchemy πŸ™‚

Since the docstore is not used/populated (to simplify storage and prevent duplication), all you have is the vector_store API (which unfortunately lacks a get() method right now), so you can query your DB directly
Add a reply
Sign up and join the conversation on Discord