feat: implement AI tutor memory and RAG system for continuous learning
- Added chat sessions and message persistence for interaction history. - Integrated Knowledge Base (RAG) using PostgreSQL Full Text Search. - Implemented automated ingestion of lesson content during course sync. - Updated AITutor frontend to support persistent session IDs via localStorage. - Added database migrations for chat_sessions, chat_messages, and knowledge_base. - Fixed SQLx build issues to allow offline Docker image compilation.
This commit is contained in:
@@ -354,13 +354,13 @@ export const lmsApi = {
|
||||
return res.json();
|
||||
});
|
||||
},
|
||||
async chatWithTutor(lessonId: string, message: string): Promise<{ response: string }> {
|
||||
async chatWithTutor(lessonId: string, message: string, sessionId?: string): Promise<{ response: string, session_id: string }> {
|
||||
return apiFetch(`/lessons/${lessonId}/chat`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ message })
|
||||
body: JSON.stringify({ message, session_id: sessionId })
|
||||
});
|
||||
},
|
||||
async getLessonFeedback(lessonId: string): Promise<{ response: string }> {
|
||||
async getLessonFeedback(lessonId: string): Promise<{ response: string, session_id: string }> {
|
||||
return apiFetch(`/lessons/${lessonId}/feedback`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user