Find answers from the community

s
F
Y
a
P
Updated 9 months ago

```

Plain Text
chat_id = "test"
docstore = RedisDocumentStore.from_redis_client(
    redis_client=redis_client,
    namespace="Docstore",
)
index_store = RedisIndexStore.from_redis_client(
    redis_client=redis_client,
    namespace="IndexStore"
)
vector_store = RedisVectorStore(
    redis_url=f"redis://:{REDIS_DB_PASSWORD}@{REDIS_DB_HOST}:{REDIS_DB_PORT}/0",
    index_name="VectorStore" + chat_id,
    index_prefix=chat_id
)

storage_context=StorageContext.from_defaults(
    docstore=docstore, index_store=index_store, vector_store=vector_store
)

index = VectorStoreIndex(
    nodes=[],
    storage_context=storage_context,
    service_context=service_context)

print(index.as_chat_engine(ChatMode.CONTEXT).chat("hola"))


The code above fails. With the following error:

raise response
redis.exceptions.ResponseError: VectorStoretest: no such index
L
b
L
9 comments
It might not be getting created if theres no documents
Just a hunch, I know a few vector stores work like that
@LORKA Were you able to mak it work?
In this case the problem was not having any nodes to build the index from
For this use case I moved to EmptyIndex
Another solution I found effective was to start from a Document(text=" "). Not the most elegant but avoids handling two types of indexes
I also recommend changing the Vectorstore to a qdrant
I was working on something simliar
@LORKA I seem to be having an issue reloading the index back after closing the app
Add a reply
Sign up and join the conversation on Discord