Skip to content

Add samples/llm-chatbot: Dozer + LLM + Vector DB + Langchain sample (#1690) - #2525

Open
CallumJB125 wants to merge 1 commit into
getdozer:mainfrom
CallumJB125:sample-llm-vector-langchain
Open

CallumJB125 wants to merge 1 commit into
getdozer:mainfrom
CallumJB125:sample-llm-vector-langchain

Conversation

@CallumJB125

Copy link
Copy Markdown

/claim #1690
Closes #1690
Payout: 0xB43A9e048032049A2f8553739ED124C15f00487b (EVM/USDC)

What this adds

Complete working sample for #1690, based on the hyper-personalization article (getdozer.io/blog/llm-chatbot). A bank chatbot answers customer questions using a unified customer profile that Dozer builds in real time from multiple datasets (customer profiles, transactions, credit-card products), combined with RAG over the product catalog in a vector database, orchestrated with Langchain.

samples/llm-chatbot/:

  • docker-compose.yml — postgres:16 (seeded) + qdrant + getdozer/dozer + chatbot service; one docker compose up --build
  • dozer-config.yaml — 3 Postgres sources → SQL join + aggregation → unified customer_profile endpoint, plus customers / transactions / products endpoints with primary + secondary indexes
  • seed/init.sql — 5 customers, 18 transactions, 5 credit-card products
  • chatbot/ — Langchain app: Dozer REST client, Qdrant indexing + retrieval (OpenAI embeddings, or a dependency-free hashing embedder), prompt assembly with chat history, FastAPI + interactive CLI entrypoints
  • tests/test_sample.py — 6 end-to-end smoke tests over the full chain
  • Keyless by design: without OPENAI_API_KEY a deterministic mock LLM + hashing embeddings still run the whole pipeline (CI-friendly, zero secrets); with a key it uses gpt-4o-mini + OpenAI embeddings. OPENAI_BASE_URL also supported for vLLM/Ollama-compatible servers.

Verified end-to-end

Verified against a dozer binary built from this repo's source (v0.2.0 tag, arm64):

  • dozer run with the sample config: pipeline validation OK, REST API on :8080 serving all 4 endpoints
  • GET /health → {"status":"SERVING"}; GET / → ["/customers","/transactions","/products","/profile"]
  • Unified profile join + aggregation: customer 1001 → transaction_count=4, total_spend=2190.40
  • Query DSL: {"$filter":{"customer_id":1003},"$order_by":{"amount":"desc"},"$limit":3} → 1450.00, 980.00, 890.00
  • Chatbot chain: 5 products indexed into Qdrant; a travel question retrieves Velocity Travel Rewards first, a groceries question retrieves Everyday Cashback; replies are personalized from the Dozer profile
  • pytest tests/test_sample.py → 6 passed

No demo video attached yet — happy to record one if useful; the test suite and commands above reproduce the full flow.

Complete working sample for getdozer#1690, based on the hyper-personalization
article (getdozer.io/blog/llm-chatbot):

- docker-compose.yml: Postgres (seeded customer profiles, transactions,
  credit-card products) + Qdrant (vector store) + Dozer + chatbot
- dozer-config.yaml: ingests the three datasets, builds a unified
  customer profile via SQL join + aggregation, serves REST/gRPC
- chatbot/: Langchain app - Dozer REST client, Qdrant RAG over the
  product catalog, prompt assembly, FastAPI + CLI entrypoints
- Works keyless (mock LLM + hashing embeddings) for CI; real LLM with
  OPENAI_API_KEY
- tests/: end-to-end smoke tests over the full chain

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sample: Dozer + LLM + Vector database + Langchain sample

1 participant