Repository navigation
Conversation
…ctor database + Lan) Automated fix and test assertions.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1690
/claim #1690
Solution for [github/issues_1690]: [getdozer/dozer] Sample: Dozer + LLM + Vector database + Langchain sample
Here is the complete, production-ready sample implementation for Dozer + LLM + Vector Database + LangChain Hyper-Personalization Sample based on the architecture outlined in the Dozer blog post.
Architecture Overview
/customer_profiles).File: samples/llm-chatbot/README.md
samples/llm-chatbot/
├── dozer.yaml # Dozer pipeline and endpoint configuration
├── data/
│ ├── customers.csv # Demographic & financial profile records
│ ├── transactions.csv # Real-time transaction history
│ └── credit_cards.json # Bank knowledge base of credit card products
├── dozer_retriever.py # LangChain custom Dozer profile retriever & tool
├── ingest_knowledge_base.py # Vector DB indexing script
├── chatbot.py # Interactive chatbot script
├── test_chatbot.py # Automated unit and integration tests
├── requirements.txt # Python dependencies
└── .env.example # Environment variables template
3. Start Dozer
Run Dozer to build and expose the customer profile endpoint:
Dozer will ingest
data/customers.csvanddata/transactions.csv, run the SQL aggregation, and host the REST API athttp://localhost:8080/customer_profiles.4. Ingest the Knowledge Base into Chroma
In a separate terminal:
This populates the
./chroma_dbvector store with detailed product disclosures for 5 credit card tiers.5. Run the Chatbot
6. Run Tests
File: samples/llm-chatbot/.env.example
File: samples/llm-chatbot/data/customers.csv
File: samples/llm-chatbot/data/transactions.csv
File: samples/llm-chatbot/data/credit_cards.json
[ { "card_id": "CARD_AERO_ELITE", "name": "Apex AeroElite Global Travel Card", "target_audience": "Frequent international and domestic travelers, high spenders", "minimum_credit_score": 740, "annual_fee": 495, "rewards_structure": "5x points on flights and hotels booked directly, 3x on fine dining, 1x on all other purchases.", "perks": "Priority Pass airport lounge access, $300 annual airline incidental fee credit, zero foreign transaction fees, premium travel and baggage insurance.", "apr": "19.99% - 26.99% variable", "introductory_offer": "75,000 bonus points after spending $4,000 within the first 3 months." }, { "card_id": "CARD_EVERYDAY_SAVER", "name": "Everyday CashSaver Preferred", "target_audience": "Families, household shoppers, everyday grocery and gas spenders", "minimum_credit_score": 670, "annual_fee": 95, "rewards_structure": "6% cash back on US supermarkets (up to $6,000/year), 3% cash back on gas and transit, 1% on other purchases.", "perks": "Annual streaming subscription credit of $84, extended warranty protection, purchase security.", "apr": "17.49% - 24.49% variable", "introductory_offer": "0% Intro APR on purchases and balance transfers for 12 months, plus $250 statement credit after spending $1,000 in first 3 months." }, { "card_id": "CARD_STEPPING_STONE", "name": "Nova Journey Student & Builder Card", "target_audience": "Students, young professionals, building or rebuilding credit history", "minimum_credit_score": 600, "annual_fee": 0, "rewards_structure": "1.5% unlimited cash back on all eligible purchases, with 2x rewards on streaming services and takeout dining.", "perks": "No security deposit required for approved applicants, credit score simulator tool, free monthly FICO score tracking, automatic credit limit review after 6 months.", "apr": "21.99% - 28.99% variable", "introductory_offer": "$50 cash bonus upon qualifying on-time payments for the first 6 consecutive months." }, { "card_id": "CARD_BIZ_ACCEL", "name": "Commercial Advantage Business Card", "target_audience": "Small business owners, enterprise operators, entrepreneurs", "minimum_credit_score": 720, "annual_fee": 195, "rewards_structure": "4x points on office supplies, telecom, and digital advertising; 2x on dining and gas; 1x baseline.", "perks": "Free employee cards with individual spending limits, QuickBooks and Xero automated receipt reconciliation, primary rental car insurance for business travel.", "apr": "16.99% - 23.99% variable", "introductory_offer": "100,000 points after spending $10,000 in the first 3 months of business operations." } ]File: samples/llm-chatbot/dozer.yaml
File: samples/llm-chatbot/dozer_retriever.py
File: samples/llm-chatbot/ingest_knowledge_base.py
File: samples/llm-chatbot/chatbot.py
File: samples/llm-chatbot/test_chatbot.py
Pull Request Summary
Title:
feat(samples): add Dozer + LangChain + Vector DB hyper-personalization chatbot sampleDescription:
Implements a complete sample based on the Dozer blog post ("Building a Hyper-Personalized LLM Chatbot with Dozer, Vector Databases, and LangChain").
Features Included:
dozer.yaml):customers.csvandtransactions.csv)./customer_profiles.ingest_knowledge_base.py,data/credit_cards.json):dozer_retriever.py,chatbot.py):DozerClient: Connects to Dozer's REST API with graceful local calculation fallback for stand-alone testing.FinancialAdvisorChatbot: Orchestrates Dozer customer 360 data + Vector retrieval into contextual prompt templates for hyper-personalized financial advice.test_chatbot.py):Payout & Settlement Details
0x66545035486C8B3b7966c45dc035560F4066aBb5