Skip to content

Two problems in running rag-conent sample script with Llama Stack 0.4.3 #71

@TamiTakamiya

Description

@TamiTakamiya

Today (Feb 1, 2026) I have tried to run the sample script in README.md with the latest code based on Llama Stack 0.4.3 and found two issues:

  1. Value Error in running query_rag.py script.

I followed the instructions in README.md and created vector DB with ./custom_docs/0.1/info.txt and custom_processory.py. Unlike the previous Llama Stack 0.3.5, the script terminated properly without pressing Ctrl-C. However, the following scripts/quey_rag.py failed with:

/home/ttakamiy/git/lightspeed-core/rag-content/.venv/bin/python scripts/query_rag.py -p vector_db/custom_docs/0.1 -x custom-docs-0_1 -m embeddings_model -k 5 -q how can I configure a cinder backend 
Command line used: scripts/query_rag.py -p vector_db/custom_docs/0.1 -x custom-docs-0_1 -m embeddings_model -k 5 -q how can I configure a cinder backend
Traceback (most recent call last):
  File "/home/ttakamiy/git/lightspeed-core/rag-content/scripts/query_rag.py", line 324, in <module>
    _llama_stack_query(args)
  File "/home/ttakamiy/git/lightspeed-core/rag-content/scripts/query_rag.py", line 191, in _llama_stack_query
    with lib_client.LlamaStackAsLibraryClient(cfg_file) as client:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/library_client.py", line 154, in __init__
    loop.run_until_complete(self.async_client.initialize())
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/library_client.py", line 290, in initialize
    await self.stack.initialize()
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/stack.py", line 596, in initialize
    await register_resources(self.run_config, impls)
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/stack.py", line 232, in register_resources
    await method(**{k: getattr(obj, k) for k in obj.model_dump().keys()})
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/routing_tables/vector_stores.py", line 95, in register_vector_store
    await self.register_object(vector_store)
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/routing_tables/common.py", line 228, in register_object
    await self.dist_registry.register(obj)
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/store/registry.py", line 168, in register
    success = await super().register(obj)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/store/registry.py", line 99, in register
    raise ValueError(
ValueError: Object of type 'vector_store' and identifier 'vs_b60854ea-e555-4775-8a58-2775eec9481c' already exists. Unregister it first if you want to replace it.

Process finished with exit code 1

Note

A workaround for this errir is to remove /tmp/kv_store.db

  1. Another issue in query_rag.py. With the workaround, the script went further, but failed with:
Traceback (most recent call last):
  File "/home/ttakamiy/git/lightspeed-core/rag-content/scripts/query_rag.py", line 324, in <module>
    _llama_stack_query(args)
  File "/home/ttakamiy/git/lightspeed-core/rag-content/scripts/query_rag.py", line 197, in _llama_stack_query
    res = client.vector_io.query(
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack_client/resources/vector_io.py", line 121, in query
    return self._post(
           ^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack_client/_base_client.py", line 1252, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/library_client.py", line 225, in request
    result = loop.run_until_complete(self.async_client.request(*args, **kwargs))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/library_client.py", line 390, in request
    response = await self._call_non_streaming(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/library_client.py", line 448, in _call_non_streaming
    result = await matched_func(**body)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/routers/vector_io.py", line 144, in query_chunks
    return await self.routing_table.query_chunks(vector_store_id, query, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/routing_tables/vector_stores.py", line 114, in query_chunks
    await self.assert_action_allowed("read", "vector_store", vector_store_id)
  File "/home/ttakamiy/git/lightspeed-core/rag-content/.venv/lib64/python3.12/site-packages/llama_stack/core/routing_tables/common.py", line 240, in assert_action_allowed
    raise ValueError(f"{type.capitalize()} '{identifier}' not found")
ValueError: Vector_store 'custom-docs-0_1' not found

Process finished with exit code 1

Note

This seems to require a code change, i.e. replacing custom-docs-0_1 with the vector DB ID (e.g. vs_b60854ea-e555-4775-8a58-2775eec9481c). If vector_io.query call in query_rag.py is modified to

      vector_store_id = cfg['registered_resources']['vector_stores'][0]['vector_store_id']
      res = client.vector_io.query(
          vector_store_id=vector_store_id, query=args.query, params=query_cfg
          #           vector_store_id = args.product_index, query = args.query, params = query_cfg
      )

It could retrieve the data from the vector store.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions