A conversational RAG-based (Retrieval-Augmented Generation) chatbot powered by LangChain and Amazon Nova Lite to help you prepare for Data Engineering interviews. The chatbot provides structured answers with definitions, use cases, and real-world examples based on comprehensive competency frameworks.
- π― Conversational Flow: Natural conversation flow asking for practice questions β topic selection β generating content
- π Structured Learning: Answers formatted with:
- π Definition - Clear explanation of concepts
- π‘ Use Case - Practical applications
- π Real-World Example - Industry examples and best practices
- π RAG Architecture: ChromaDB vector store + LangChain retrieval for accurate, context-aware answers
- β‘ Amazon Nova Lite: Fast, cost-effective LLM for interview prep
- ποΈ Vector Search: Amazon Titan Embeddings for semantic search
- π¬ Streamlit Interface: Beautiful, interactive chat interface
- π Topic Coverage: Python, SQL, Database, ETL competencies from CSV documentation
- Python 3.10+
- AWS Account with Bedrock access (Nova Lite & Titan Embeddings)
- AWS credentials configured
- UV package manager (recommended) or pip
cd data_engineering_interview_prep_chatbotUsing UV (recommended):
uv syncOr using pip:
pip install -r requirements.txtCreate a .env file in the project root:
# AWS Bedrock Configuration
AWS_REGION=us-east-1
aws_access_key_id=YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key=YOUR_AWS_SECRET_ACCESS_KEY
# aws_session_token=YOUR_SESSION_TOKEN # Optional: if using temporary credentialsNote: Copy .env.example to .env and fill in your credentials.
This creates the ChromaDB vector database from CSV documentation:
python src/ingestion_csv.pyExpected output:
======================================================================
DATA ENGINEERING INTERVIEW PREP - VECTOR STORE SETUP
======================================================================
π Creating new vector store...
π Loading DE docs - Python.csv...
π Loading DE docs - SQL.csv...
π Loading DE docs - Database.csv...
β
Loaded 150+ documents from CSV files
π Creating vector store with 150+ documents...
β
Vector store created and persisted to data/vector_db
======================================================================
SETUP COMPLETE!
======================================================================
Streamlit Web App (Recommended):
streamlit run app.pyThen open your browser to http://localhost:8501
The chatbot follows a natural conversation flow:
- Welcome: Bot introduces itself and available topics
- Request Practice: User says "give me practice questions" or similar
- Topic Selection: User chooses: Python, SQL, Database, or ETL
- Generate Content: Bot retrieves relevant competencies and generates:
- Interview practice questions (Entry/Mid/Advanced levels)
- Key competencies with Definition, Use Case, and Real-World Examples
- Continue Learning: Ask follow-up questions or explore more topics
π Welcome! I'm here to help you prepare for Data Engineering interviews.
I can help you practice with interview questions and learn key competencies in:
- π Python - Data engineering with Python
- πΎ SQL - Queries and database operations
- ποΈ Database - RDBMS design and optimization
- π ETL - Data pipelines and transformations
How would you like to get started?
---
User: give me practice questions for the interview
AI: Which topic would you like to practice?
Please select ONE topic to get started:
- π Python
- πΎ SQL
- ποΈ Database
- π ETL
---
User: Python
AI: [Generates comprehensive practice content including:]
π Interview Practice Questions for Python
Entry-Level Questions (Must Have):
1. Explain the difference between lists, tuples, and dictionaries...
2. How do you handle errors in Python?...
Mid-Level Questions (Desirable):
3. What are decorators and when would you use them?...
Advanced Questions (Best Practice):
4. How would you optimize a data pipeline for large-scale processing?...
Key Competencies:
**Topic: List Comprehensions**
π Definition:
List comprehensions provide a concise way to create lists...
π‘ Use Case:
Used in ETL pipelines for data transformation...
π Real-World Example:
In a production data pipeline, filtering millions of records...
---
π‘ Want to dive deeper? Ask specific questions about Python,
or say 'more topics' to explore other areas!
---
User: Tell me more about decorators
AI: [Generates detailed answer with definition, use case, example]
---
User: great give me more topics
AI: [Returns to topic selection]
What are list comprehensions?
Definition: List comprehensions are concise, Pythonic syntax for creating new lists by applying an expression to each item in an iterable, optionally filtering items with a condition.
Use Case: Used extensively in data engineering for transforming, filtering, and processing data in ETL pipelines, especially when working with in-memory datasets before loading into databases or data warehouses.
Real-World Example: In a data pipeline, you might extract user IDs from a list of user dictionaries while filtering out inactive users: active_user_ids = [user['id'] for user in users if user['status'] == 'active']
Code Example:
emails = ['john@gmail.com', 'invalid', 'jane@yahoo.com', 'bob@'] domains = [email.split('@')[1] for email in emails if '@' in email and '.' in email]
Key Interview Notes:
- More readable and faster than equivalent for-loops
- Can include if conditions for filtering
- Can be nested but avoid deep nesting for readability
## ποΈ Architecture
### Project Structure
data_engineering_interview_prep_chatbot/ βββ app.py # Streamlit chatbot application βββ data/ β βββ raw_docs/ # Source CSV files β β βββ DE docs - Python.csv β β βββ DE docs - SQL.csv β β βββ DE docs - Database.csv β β βββ DE docs - ETL.csv β βββ vector_db/ # ChromaDB vector store (created after ingestion) β βββ chroma.sqlite3 βββ src/ β βββ init.py β βββ ingestion_csv.py # CSV document loading and vector store creation β βββ rag_retrieval.py # RAG retrieval and answer generation βββ utils/ β βββ helper_cred.py # AWS Bedrock LLM & embeddings configuration βββ .env # Environment variables (create from .env.example) βββ .env.example # Environment template βββ pyproject.toml # UV project configuration βββ requirements.txt # Python dependencies βββ README.md
### RAG Pipeline Flow
User Input: "give me practice questions" β Chatbot: "Which topic?" β User: "Python" β Vector Store Retrieval (ChromaDB)
- Filters by topic metadata
- Retrieves top 10 relevant documents β Retrieved Context + User Query + Instructions β Amazon Nova Lite LLM β Structured Response:
- Practice questions (Entry/Mid/Advanced)
- Competency breakdown:
- π Definition
- π‘ Use Case
- π Real-World Example
### Conversation State Management
The chatbot maintains three conversation stages:
1. **greeting** - Initial welcome
2. **topic_selection** - User selects topic
3. **practicing** - Active Q&A session
## π§ Configuration
### Model Information
The chatbot uses AWS Bedrock services:
- **LLM**: Amazon Nova Lite v1:0 (`amazon.nova-lite-v1:0`)
- Temperature: 0.5
- Max tokens: 1000
- **Embeddings**: Amazon Titan Embed Text v1 (`amazon.titan-embed-text-v1`)
- **Vector Store**: ChromaDB with persistent storage
- **Region**: us-east-1 (configurable via .env)
All configuration is in [utils/helper_cred.py](utils/helper_cred.py)
### Customization Options
**Change LLM Parameters** - Edit [utils/helper_cred.py](utils/helper_cred.py):
```python
llm = ChatBedrock(
model_id="amazon.nova-lite-v1:0",
model_kwargs={
"temperature": 0.7, # Adjust creativity (0-1)
"max_new_tokens": 2000 # Adjust response length
}
)
Modify Retrieval - Edit src/rag_retrieval.py:
self.retriever = vectorstore.as_retriever(
search_type="similarity",
search_kwargs={"k": 10} # Number of documents to retrieve
)Customize Prompts - Edit prompt templates in src/rag_retrieval.py
The CSV files follow this competency framework structure:
| Competency Area | Topics | Must Have | Desirable | Advanced/ Best |
|---|---|---|---|---|
| Python | List comprehensions | Basic usage | Advanced patterns | Production optimization |
Each competency level provides:
- Must Have: Foundational knowledge (Definition)
- Desirable: Intermediate application (Use Case)
- Advanced: Best practices (Real-World Example)
- Add CSV file to
data/raw_docs/following the competency format - Update topic mapping in src/ingestion_csv.py:
csv_files = {
"Python": "DE docs - Python.csv",
"SQL": "DE docs - SQL.csv",
"Database": "DE docs - Database.csv",
"ETL": "DE docs - ETL.csv",
"AWS": "DE docs - AWS.csv" # New topic
}- Update topic detection in app.py
detect_topic_from_message()function - Re-run ingestion:
python src/ingestion_csv.py
# Test vector store creation
python src/ingestion_csv.py
# Test RAG retrieval
python src/rag_retrieval.py
# Run the Streamlit app
streamlit run app.pySolution: Run the ingestion script to create the vector store:
python src/ingestion_csv.pySolutions:
- Ensure
.envfile exists with valid AWS credentials - Verify the region supports Bedrock (use
us-east-1) - Check that your AWS account has Bedrock access enabled
- Verify Nova Lite and Titan Embeddings models are available
Solution: Install all dependencies:
uv sync
# or
pip install -r requirements.txtSolution: Delete and recreate the vector store:
# Windows
Remove-Item -Recurse -Force data\vector_db
# Linux/Mac
rm -rf data/vector_db
# Re-run ingestion
python src/ingestion_csv.pySolution: Use a different port:
streamlit run app.py --server.port 8502- Be Specific: Ask detailed questions about specific concepts
- Use Topic Names: Mention the topic area in your questions
- Follow the Flow: Let the chatbot guide you through topic selection
- Explore Systematically: Work through one topic at a time
- Ask Follow-ups: Dig deeper into concepts that interest you
Every response includes structured sections:
Question:
[User's question repeated]
Definition:
[Clear, interview-level definition]
Use Case:
[When/why used in data engineering]
Real-World Example:
[Industry-relevant example]
Code Example (if applicable):
[Clean, production-quality code with comments]
Key Interview Notes:
- [Important point 1]
- [Important point 2]
- [Important point 3]
- Add AWS-specific documentation
- Support for follow-up questions with context
- Export conversation history
- Add more topics (Spark, Kafka, Airflow, etc.)
- Quiz mode for self-assessment
- Difficulty levels (Junior, Mid-level, Senior)
MIT License
Example Response:
π Interview Practice Questions for Python
Entry-Level Questions (Must Have):
1. What are the main differences between lists and tuples in Python?
2. How do you handle exceptions in Python?
3. Explain basic list comprehensions.
Mid-Level Questions (Desirable):
4. How would you use decorators in a data pipeline?
5. What's the difference between map/filter/reduce?
Advanced Questions (Best Practice):
6. How do you optimize memory usage in large-scale data processing?
---
**Concept: List Comprehensions**
π Definition:
List comprehensions provide a concise, readable way to create lists
by applying an expression to each item in an iterable.
π‘ Use Case:
Commonly used in ETL pipelines to transform data efficiently without
explicit for-loops. Ideal for filtering and mapping operations on datasets.
π Real-World Example:
In a production data pipeline processing user events, you might extract
active user IDs: `active_users = [user['id'] for user in users if user['status'] == 'active']`
This is more efficient and readable than traditional loops.
- β Conversational Interface - Natural dialogue flow
- β Topic-Filtered Retrieval - Accurate, relevant content
- β Multi-Level Questions - Entry, Mid, Advanced practice questions
- β Structured Answers - Consistent format for learning
- β AWS Bedrock Integration - Production-ready LLM
- β Vector Search - Fast, semantic document retrieval
- β Persistent Storage - ChromaDB for efficient queries
- β Streamlit UI - Beautiful, responsive interface
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test thoroughly
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Add more topics (AWS, Spark, Kafka, etc.)
- Enhance prompt templates
- Add more example questions
- Improve UI/UX
- Add testing coverage
- Optimize retrieval performance
This project is for educational purposes. Check individual dependencies for their licenses.
- LangChain for the RAG framework
- AWS Bedrock for Nova Lite and Titan Embeddings
- ChromaDB for vector storage
- Streamlit for the beautiful UI
- The Data Engineering community for competency frameworks
Good luck with your Data Engineering interviews! πΌπ