Verify the vector database
Verify that you created a vector database of your documentation.
Procedure
- Run the following command:
ls -lR outputThe tool generates an image archive (.tar), which contains the vector database files and metadata. The following shows the structure of the output directory:In the example above:output ├── rag-content-output-latest.tar └── vector_db ├── faiss_store.db └── llama-stack.yamlrag-content-output-latest.taris the generated image archive.faiss_store.dbis the vector database file.llama-stack.yamlis the Llama Stack configuration file.
- Verify that you get the expected results by querying the generated vector database using the following command:
podman run --rm \ -u 0 \ -v "$(pwd)/output/vector_db:/vector_db:Z" \ registry.redhat.io/lightspeed-core/rag-tool-rhel9:v0.5-latest \python scripts/query_rag.py \ -p /vector_db \ -x index \ -m embeddings_model \ -k 5 \ -q "Prerequisites for installation"In the example above:-ktells the AI tool to find the five most relevant matches from your documentation.-qis your prompt; change the string according to your requirements.
The command displays the top five query results, along with the scores. Verify that the results are expected.