Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
143 lines (102 loc) · 4.52 KB

File metadata and controls

143 lines (102 loc) · 4.52 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

Configuring an Alternative Vector Database

---
depth: 2
local: true
backlinks: none
---

Supported Vector Databases

By default, the Docker Compose files for the examples deploy Milvus as the vector database. Alternatively, you can deploy pgvector.

Configuring pgvector as the Vector Database

  1. Edit the Docker Compose file for the example, such as deploy/compose/rag-app-text-chatbot.yaml.

    Update the environment variables within the chain server service:

    services:
      chain-server:
        container_name: chain-server
        environment:
          APP_VECTORSTORE_NAME: "pgvector"
          APP_VECTORSTORE_URL: "pgvector:5432"
          POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
          POSTGRES_USER: ${POSTGRES_USER:-postgres}
          POSTGRES_DB: ${POSTGRES_DB:-api}

    The preceding example shows the default values for the database user, password, and database. To override the defaults, edit the values in the Docker Compose file, or set the values in the compose.env file.

    If you have existing setup remove deploy/compose/volumes directory to avoid pgvector crash.

  2. Optional: If a container for a vector database is running, stop the container:

    $ docker compose -f deploy/compose/docker-compose-vectordb.yaml down
  3. Stop and then start the services:

    $ docker compose --env-file deploy/compose/compose.env -f deploy/compose/<rag-example>.yaml down
    $ docker compose --env-file deploy/compose/compose.env -f deploy/compose/<rag-example>.yaml up -d --remove-orphans
  4. Start the pgvector container:

    $ docker compose -f deploy/compose/docker-compose-vectordb.yaml up -d pgvector
  5. Optional: View the chain server logs to confirm the vector database.

    1. View the logs:

      $ docker logs -f chain-server
    2. Upload a document to the knowledge base. Refer to for more information.

    3. Confirm the log output includes the vector database:

      INFO:RetrievalAugmentedGeneration.common.utils:Using pgvector as vector store
      INFO:RetrievalAugmentedGeneration.common.utils:Using PGVector collection: <example-name>
      

Configuring Milvus as the Vector Database

  1. Edit the Docker Compose file for the example, such as deploy/compose/rag-app-text-chatbot.yaml.

    Update the environment variables within the chain server service:

    services:
      chain-server:
        container_name: chain-server
        environment:
          APP_VECTORSTORE_NAME: "milvus"
          APP_VECTORSTORE_URL: "http://milvus:19530"
  2. Optional: If a container for a vector database is running, stop the container:

    $ docker compose -f deploy/compose/docker-compose-vectordb.yaml down
  3. Stop and then start the services:

    $ docker compose --env-file deploy/compose/compose.env -f deploy/compose/<rag-example>.yaml down
    $ docker compose --env-file deploy/compose/compose.env -f deploy/compose/<rag-example>.yaml up -d --remove-orphans
  4. Start the Milvus container:

    $ docker compose -f deploy/compose/docker-compose-vectordb.yaml up -d milvus
  5. Optional: View the chain server logs to confirm the vector database.

    1. View the logs:

      $ docker logs -f chain-server
    2. Upload a document to the knowledge base. Refer to for more information.

    3. Confirm the log output includes the vector database:

      INFO:RetrievalAugmentedGeneration.common.utils:Using milvus as vector store
      INFO:RetrievalAugmentedGeneration.common.utils:Using milvus collection: <example-name>
      
Morty Proxy This is a proxified and sanitized view of the page, visit original site.