Chatbot Implementation - Week 1 Kickoff Guide
Date Started: October 9, 2025
Phase: Week 1 of 10
Status: 🚀 Implementation Started
🎯 Week 1 Goals
Build the Core Chatbot Infrastructure foundation:
- ✅ Install all required dependencies
- 🔨 Create project structure
- 🔨 Build conversational layer (Rasa + spaCy)
- 🔨 Create basic API endpoints
- 🔨 Build Streamlit demo UI
- 🔨 Test end-to-end flow
📦 Step 1: Dependencies Installation
Core Conversational AI
# Rasa for intent recognition & dialogue
pip install rasa>=3.6.0
# NLP libraries
pip install spacy>=3.7.0
pip install nltk>=3.8.1
# Download spaCy model
python -m spacy download en_core_web_lg
UI Components (for demos)
pip install streamlit>=1.28.0
pip install streamlit-chat>=0.1.1
pip install gradio>=4.0.0
Additional utilities
pip install python-dotenv>=1.0.0
pip install pyyaml>=6.0.1
🗂️ Step 2: Project Structure
Create the following directories and files:
recoagent/
├── packages/
│ ├── conversational/ # NEW
│ │ ├── __init__.py
│ │ ├── intent_recognition.py # Rasa NLU integration
│ │ ├── entity_extraction.py # spaCy integration
│ │ ├── dialogue_manager.py # Rasa Core integration
│ │ └── config/
│ │ ├── nlu_config.yml # Rasa NLU config
│ │ ├── domain.yml # Rasa domain
│ │ └── stories.yml # Conversation flows
│ │
│ └── agents/ # EXISTING (enhance)
│ └── chatbot_orchestrator.py # NEW: Chatbot-specific orchestration
│
├── apps/
│ └── api/
│ ├── chatbot_api.py # NEW: Chatbot endpoints
│ └── main.py # EXISTING (enhance)
│
├── examples/
│ └── chatbot/ # NEW
│ ├── streamlit_demo.py # Quick demo UI
│ ├── basic_chatbot.py # Basic usage example
│ └── README.md # Examples documentation
│
└── tests/
└── test_conversational/ # NEW
├── test_intent_recognition.py
├── test_entity_extraction.py
└── test_dialogue_manager.py
🛠️ Step 3: Build Components
Task 3.1: Intent Recognition Layer
File: packages/conversational/intent_recognition.py
Purpose: Understand user intent using Rasa NLU
Key Features:
- Load Rasa NLU model
- Classify user intent
- Extract confidence scores
- Multi-language support (future)
Integration: Pre-processing before LangGraph agent
Task 3.2: Entity Extraction
File: packages/conversational/entity_extraction.py
Purpose: Extract entities using spaCy
Key Features:
- Named entity recognition
- Custom entity patterns
- Context-aware extraction
- Integration with Rasa entities
Task 3.3: Dialogue Manager
File: packages/conversational/dialogue_manager.py
Purpose: Manage multi-turn conversations using Rasa Core
Key Features:
- Conversation state tracking
- Context management
- Slot filling
- Follow-up question handling
Task 3.4: Chatbot API Endpoints
File: apps/api/chatbot_api.py
Endpoints to Create:
POST /chatbot/message # Send message to chatbot
GET /chatbot/history/{user_id} # Get conversation history
POST /chatbot/feedback # Submit feedback
GET /chatbot/intents # List available intents
WS /chatbot/stream # WebSocket for streaming
Task 3.5: Streamlit Demo
File: examples/chatbot/streamlit_demo.py
Features:
- Simple chat interface
- Message history
- Intent display
- Entity display
- Agent selection
- Clear conversation button
🔄 Step 4: Integration Flow
User Input
↓
Intent Recognition (Rasa NLU)
↓
Entity Extraction (spaCy)
↓
Dialogue Management (Rasa Core)
↓
Agent Selection (Route to LangGraph)
↓
Existing LangGraph Agent
↓
Response
✅ Step 5: Testing Checklist
Unit Tests
- Test intent recognition accuracy
- Test entity extraction
- Test dialogue state management
- Test API endpoints
- Test Streamlit UI
Integration Tests
- Test intent → LangGraph flow
- Test multi-turn conversations
- Test conversation history
- Test error handling
Manual Testing
- Send simple query through Streamlit
- Test multi-turn conversation
- Test intent switching
- Test error scenarios
📊 Success Criteria for Week 1
Must Have
- ✅ All dependencies installed
- ✅ Project structure created
- ✅ Basic intent recognition working
- ✅ Entity extraction functional
- ✅ Simple dialogue flow working
- ✅ API endpoints responding
- ✅ Streamlit demo functional
Nice to Have
- ⚠️ Multiple intents trained
- ⚠️ Custom entity patterns
- ⚠️ Error handling polished
- ⚠️ Logging comprehensive
🚀 Getting Started
Immediate Actions (Today)
-
Install Dependencies
cd /Users/sparshagarwal/Desktop/work/recohut/recoagent
pip install rasa>=3.6.0 spacy>=3.7.0 streamlit>=1.28.0
python -m spacy download en_core_web_lg -
Create Project Structure
mkdir -p packages/conversational/config
mkdir -p examples/chatbot
mkdir -p tests/test_conversational -
Create Initial Files
- Create
__init__.py
files - Create placeholder files for each component
- Set up basic Rasa configuration
- Create
📝 Implementation Order
Day 1-2: Setup & Intent Recognition
- Install dependencies
- Create project structure
- Build intent recognition layer
- Create basic Rasa NLU config
- Train first model
Day 3-4: Entity Extraction & Dialogue
- Build entity extraction
- Integrate with spaCy
- Create dialogue manager
- Test multi-turn conversations
Day 5-6: API & UI
- Create API endpoints
- Build Streamlit demo
- Integrate with existing agents
- Test end-to-end flow
Day 7: Testing & Polish
- Write unit tests
- Write integration tests
- Fix bugs
- Document code
🎯 Milestones
- Milestone 1.1 (Day 2): Intent recognition working
- Milestone 1.2 (Day 4): Dialogue management functional
- Milestone 1.3 (Day 6): Streamlit demo deployed
- Milestone 1.4 (Day 7): All tests passing
📚 Resources
Documentation
- Rasa Docs: https://rasa.com/docs/
- spaCy Docs: https://spacy.io/
- Streamlit Docs: https://docs.streamlit.io/
Tutorials
- Rasa Quickstart: https://rasa.com/docs/rasa/playground
- spaCy 101: https://course.spacy.io/
- Streamlit Chat App: https://docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps
Examples
- Rasa Examples: https://github.com/RasaHQ/rasa/tree/main/examples
- spaCy Projects: https://spacy.io/usage/projects
🐛 Common Issues & Solutions
Issue 1: Rasa Installation Fails
Solution: Use specific versions, install dependencies separately
pip install tensorflow>=2.12.0
pip install rasa>=3.6.0
Issue 2: spaCy Model Not Found
Solution: Download model explicitly
python -m spacy download en_core_web_lg
Issue 3: Streamlit Port Conflict
Solution: Use different port
streamlit run app.py --server.port 8502
💡 Tips for Success
- Start Simple: Get basic flow working first
- Test Early: Test each component as you build
- Use Examples: Refer to Rasa examples for patterns
- Document: Add docstrings and comments
- Iterate: Don't aim for perfection in Week 1
📞 Next Steps After Week 1
Once Week 1 is complete:
- Week 2: Enhance dialogue flows, add more intents
- Week 3-4: Build production UI (Chainlit)
- Week 5: Add multi-channel support
- Week 6: Add voice capabilities
✅ Ready to Start!
Current Status: Setup phase
Next Action: Install dependencies and create project structure
Let's build this! 🚀