Practical Examples
Three runnable tracks: Chroma over local Markdown, pgvector on an existing Postgres, and Qdrant filters with a hybrid teaser. Reuse embed_openai or embed_ollama from Embeddings (CPU is enough). Python 3.10+.
Use window_split from Chunking in real FAQs. Below, each short file is one chunk to keep the page focused.
Example 1: Chroma FAQ over Markdown
Goal: Q&A over faq/*.md. Answers must use made-up clauses in the files.
faq/refund.md:
faq/hours.md:
Check: Ask about KH-8842 / 7 days; then ask for a stock price (should refuse). Use hit_at_k from Evaluation on refund-0.
Example 2: pgvector on existing Postgres
Assume articles(id, title, body, org_id) already holds rows. Postgres basics: PostgreSQL.
Bind org_id = 42 in the application to the current tenant—do not let the model choose it. Backfill overnight. After body changes, set embedding to NULL and re-embed.
Example 3: Qdrant filter + hybrid teaser
Start the server (Qdrant), then filter by department. Leave the sparse channel as a teaser until filter hit@k is solid.
Hybrid teaser: declare dense + sparse named vectors, then Prefetch + FusionQuery(RRF) (skeleton in the Qdrant chapter). Clause HR-10 often needs keywords; “annual leave” paraphrases need dense vectors. Compare “dense + dept filter” hit@k before adding sparse.
Acceptance
You can later hang the same chunks on LangChain RAG or Dify Knowledge Base. The principles do not change.