Story 3: Online Admission Inquiry with AI Chatbot
Overview
| Field | Value |
|---|---|
| Story ID | NGE-13-3 |
| Story Points | 21 |
| Sprint | Sprint 8 |
User Story
As a Parent
I want to inquire about admission through an AI chatbot
So that I can get instant answers to my questions
Technical Implementation
AI Chatbot Service
@Injectable()
export class AdmissionChatbotService {
async chat(inquiryId: string, message: string): Promise<ChatResponse> {
// Get school context
const schoolInfo = await this.getSchoolInfo();
const feeStructure = await this.getFeeStructure();
// Build system prompt
const systemPrompt = `You are an admission assistant for ${schoolInfo.name}.
Fee Structure:
${JSON.stringify(feeStructure)}
Guidelines:
1. Be helpful and professional
2. Provide accurate admission information
3. Offer to schedule school visits
4. Respond in Hindi/English based on user`;
// Call Claude API
const response = await this.anthropic.messages.create({
model: 'claude-sonnet-4-20250514',
system: systemPrompt,
messages: [...history, { role: 'user', content: message }],
});
// Save chat history
await this.saveHistory(inquiryId, message, response);
return { message: response.content[0].text };
}
}
Public API (No Auth)
@Controller('public/admission-inquiry')
export class AdmissionInquiryController {
@Post()
@Throttle({ limit: 5, ttl: 60000 })
async submitInquiry(@Body() dto: CreateInquiryDto) {
return this.inquiryService.create(dto);
}
@Post(':inquiryNumber/chat')
@Throttle({ limit: 30, ttl: 60000 })
async chat(@Param('inquiryNumber') num: string, @Body() dto: ChatDto) {
return this.chatbotService.chat(num, dto.message);
}
}
Tasks
| Task | Title | Estimate |
|---|---|---|
| T1 | Create inquiries table | 2h |
| T2 | Build inquiry submission API | 4h |
| T3 | Implement AI chatbot | 12h |
| T4 | Build inquiry dashboard | 8h |
| T5 | Build public inquiry form | 6h |
| T6 | Build chatbot UI | 8h |