Gen-AI Developer Classroom notes 08/Mar/2026

Enterprise Vector Store

  • Possible options being
    • pgvector
    • cloud vector storages
    • pinecone

PgVector

  • Ensure docker desktop is running

  • This is postgres vector extension.

  • setting up pgvector database
Give me steps to setup pgvector on a linux instance
  • Create a folder called as initdb and create a file called as 01-enable-vector.sql with following content
CREATE EXTENSION IF NOT EXISTS vector;
  • Now cd into this folder and execute the following commands
docker pull pgvector/pgvector:pg16
docker run -d \
--name pgvector-db \
-e POSTGRES_USER=admin \
-e POSTGRES_PASSWORD=admin123 \
-e POSTGRES_DB=vectordb \
-v $(pwd)/initdb:/docker-entrypoint-initdb.d \
-p 5432:5432 \
pgvector/pgvector:pg16
  • Auto-Enable pgvector When Container Starts (Best Practice)

Enterprise Version Recommended for retrieval

  • We will define the retrieval pipeline in 4 layers

    • Layer 1: retrieval
      • pgvector
      • embedding
      • metaddata filters
      • MMR
    • Layer 2: ranking
      • top 15 initial
      • rerank to top 5
    • Layer 3: grounding
      • strict answer from context prompt
      • citations mandatory
    • Layer 4: governance
      • log retrieved chunk IDS
      • log policy titles/sections used

Search types

  • Similarity
  • MMR (Maximal Marginal Relevance). It tries to balance relevance with diversity
  • MQR (MultiQueryRetriever)

  • Refer Here for implementation based on mmr

We need to give demonstration of this RAG

  • We need a ui. A quick way to bring up a simple ui for demos is
  • Streamlit helloworld
  • Refer Here for sample streamlit which we have built.

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading