Skip to content

AI学习教练Agent - 基于AI的智能学习助手,提供个性化学习计划、资源推荐和学习陪伴功能

Notifications You must be signed in to change notification settings

VH992098059/StudyCoach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StudyCoach - AI-Powered Intelligent Teaching Assistant System

StudyCoach Logo

StudyCoach is a full-stack AI teaching assistant platform that deeply integrates RAG (Retrieval-Augmented Generation) and Agentic Workflow.

Unlike traditional "Q&A" ChatBots, StudyCoach employs a graph-based orchestration engine (Graph Orchestration) to precisely identify user intent and dynamically route requests to different processing branches such as Emotional Companionship, Task Tutoring, Knowledge Retrieval, or Tool Invocation, providing learners with immersive, multimodal intelligent services.

English Documentation | 中文文档

Go React Eino Ant Design X Docker


🌟 Key Highlights

🧠 Agent Orchestration & Multimodal Interaction

  • Graph Orchestration Engine: Built on ByteDance's CloudWeGo/Eino framework, constructing complex Directed Acyclic Graph (DAG) business flows.
  • Intent Recognition & Dynamic Routing: Automatically analyzes user input (e.g., "feeling down" vs. "help me solve this problem") and intelligently dispatches to Emotion (Emotional Model) or Task (Task Model) branches.
  • ReAct Reasoning Paradigm: Implements the Reasoning + Acting pattern, enabling AI with a "Think-Act-Observe" closed loop to autonomously invoke web search or file generation tools.
  • Full-Duplex Voice Interaction: Frontend integrates VAD (WebAssembly) for millisecond-level voice activity detection, combined with backend SSE streaming to achieve a natural "interrupt-anytime" conversation experience.

📚 Enterprise-Grade RAG Knowledge Engine

  • Hybrid Retrieval Strategy: Combines Qdrant (Vector Retrieval) and Elasticsearch (Full-Text Retrieval) to effectively solve low recall rates for specialized terminology.
  • Full-Link ETL: Built-in PDF/HTML/Word parsers (Loader) and intelligent splitters (Splitter) to automatically construct high-quality private knowledge bases.

🎨 Immersive Frontend Experience

  • Ant Design X Integration: Adopts Ant Financial's latest AI component library, providing professional Chain of Thought (CoT) display and streaming bubble interactions.
  • Multi-Format Real-Time Rendering: Perfectly supports real-time streaming rendering of LaTeX formulas, Mermaid flowcharts, Code highlighting, and Markdown tables.

🏗️ System Architecture

graph TD
    Start(("Start")) --> AnalysisTemplate["Intent Analysis Template"]
    AnalysisTemplate --> AnalysisModel["Intent Recognition Model"]
    
    AnalysisModel -->|"Route"| Branch{"Branch Decision"}
    
    %% Branch 1: Emotional Companionship
    Branch -->|"Emotion"| EmotionLambda["Emotion Param Injection"]
    EmotionLambda --> EmotionTemplate["Emotion Template"]
    EmotionTemplate --> EmotionModel["Emotion Model"]
    EmotionModel --> End(("End"))
    
    %% Branch 2 & 3: Task Tutoring & Knowledge Learning (ReAct)
    Branch -->|"Task"| TaskLambda["Task Param Injection"]
    Branch -->|"Study"| StudyLambda["Study Param Injection"]
    
    TaskLambda --> TaskTemplate["Task Tutoring Template"]
    StudyLambda --> StudyTemplate["Study Tutoring Template"]
    
    TaskTemplate --> UnifiedReActAgent["Unified ReAct Agent"]
    StudyTemplate --> UnifiedReActAgent
    
    subgraph ReActLoop ["ReAct Loop"]
        UnifiedReActAgent <-->|"Tool Invocation"| Tools["Web Search / File Gen / Hybrid Retrieval"]
    end
    
    UnifiedReActAgent --> End

    style Start fill:#f9f,stroke:#333,stroke-width:2px
    style End fill:#f9f,stroke:#333,stroke-width:2px
    style Branch fill:#bbf,stroke:#333,stroke-width:2px
    style UnifiedReActAgent fill:#bfb,stroke:#333,stroke-width:2px
Loading

🛠️ Tech Stack

Backend

  • Language: Go 1.24
  • Framework: GoFrame v2 (Web), CloudWeGo/Eino (AI Orchestration)
  • Database: MySQL 8.0+, Redis
  • AI Infrastructure:
    • Vector DB: Qdrant / Elasticsearch 8
    • Object Storage: SeaweedFS

Frontend

  • Framework: React 19, TypeScript, Vite
  • UI/UX: Ant Design 6, Ant Design X (AI Components)
  • AI Interaction:
    • VAD: @ricky0123/vad-web (Client-side Voice Detection)
    • Markdown: react-markdown, katex (Math Formulas), mermaid (Charts)
  • State Management: Redux Toolkit, React Router

📁 Project Structure Overview

studyCoach/
├── backend/                  # Go Backend Service
│   ├── internal/controller/  # Business Control Layer (GoFrame)
│   ├── studyCoach/           # AI Core Module (Eino)
│   │   ├── aiModel/          # Model & Orchestration Logic
│   │   │   ├── CoachChat/    # Teaching Assistant Orchestration Graph
│   │   │   ├── asr/          # Speech Recognition Module
│   │   │   ├── indexer/      # RAG Index Builder
│   │   │   └── retriever/    # Hybrid Retriever
│   └── manifest/             # K8s/Docker Deployment Config
│
├── frontChat/                # React Frontend Application
│   ├── src/pages/AiChat/     # AI Chat Core Page
│   │   ├── components/       # Bubbles, Input Box Components
│   │   └── hooks/            # useSSEChat, useVoiceService
│   └── src/services/         # API Interface Encapsulation
│
└── docker-compose.yml        # Containerized Environment Config

🚀 Quick Start

Prerequisites

  • Go 1.24+
  • Node.js 20+
  • Bun 1.0+
  • Docker & Docker Compose

Deploy Speech Recognition Service (SenseVoice)

The Speech Recognition (ASR) module of this project depends on the SenseVoice model. Please visit the official SenseVoice repository for detailed deployment and configuration instructions. Ensure the service is running and accessible to the backend.

Start after installation:

python api.py

1. Start Infrastructure

docker-compose up -d
# This will start MySQL, Redis, SeaweedFS, Qdrant, Elasticsearch

2. Start Backend

cd backend
# Copy and configure environment variables
cp .env.example .env
go mod tidy
go run main.go

3. Start Frontend

cd frontChat
bun install
bun run dev

Visit http://localhost:5173 to start experiencing.


🔮 Future Plans

📦 Storage Architecture Upgrade

  • SeaweedFS Migration: Completed migration from MinIO to SeaweedFS (Filer Mode) to support more efficient small file storage and directory management.

🌐 MCP (Model Context Protocol) Ecosystem Integration

We plan to fully integrate the MCP Protocol to achieve greater tool interoperability:

  • Standardized Tool Interfaces: Migrate existing DuckDuckGo search and file generation tools to standard MCP Servers.
  • Cross-Application Context: Allow AI Agents to securely access local development environments, databases, or third-party APIs, not limited to simple web searches.
  • Plugin Extensions: Developers can easily add new capabilities (such as code execution, calendar management, etc.) to StudyCoach by writing MCP Servers without modifying the core code.

⏰ Cron Job System (In Progress)

Developing a distributed cron job scheduling and execution module (backend/internal/controller/cron & cron_execute) to provide flexible task orchestration, status tracking, and background job processing capabilities.


🙏 Acknowledgements

During the implementation of the RAG (Retrieval-Augmented Generation) module, this project deeply referenced and partially utilized the excellent design of the following open-source project:

  • wangle201210/go-rag: Thanks to this project for providing valuable ideas and implementation references for building RAG links in the Go language environment.
  • wangle201210/chat-history: Thanks to this project for providing convenient chat history management capabilities for the Eino framework.

📄 License

MIT License

About

AI学习教练Agent - 基于AI的智能学习助手,提供个性化学习计划、资源推荐和学习陪伴功能

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published