Skip to content

Comments

Feature chat-agent and flashcards#3

Open
AlMiZa wants to merge 10 commits intomainfrom
feature/chat-agent
Open

Feature chat-agent and flashcards#3
AlMiZa wants to merge 10 commits intomainfrom
feature/chat-agent

Conversation

@AlMiZa
Copy link
Owner

@AlMiZa AlMiZa commented Feb 16, 2026

This pull request introduces a new ChatTutorCrew agent configuration and exports the main crew class for easier imports. The changes are grouped below by theme.
It also improves the project documentation for both the Claude and Agents guides, providing clearer instructions, detailed architecture and feature descriptions, and comprehensive onboarding for developers.

Documentation Enhancements

  • Expanded project overviews in both AGENTS.md and CLAUDE.md to clarify that Wordpan is a language learning application and added detailed descriptions of architecture, key features, and project structure. [1] [2]
  • Added step-by-step guides for adding new CrewAI crews, including best practices for agent/task configuration, schema definition with Pydantic, and endpoint creation. These guides now emphasize structured outputs, tool usage, and tracing. [1] [2] [3]
  • Provided detailed API endpoint documentation, database schema overviews, and CrewAI agent summaries in CLAUDE.md, making backend and frontend integration points explicit.
  • Included comprehensive environment setup instructions, key dependency listings, and frontend/backend component breakdowns for easier onboarding and troubleshooting.
  • Added sections on running, debugging, and common issues/solutions, as well as security and performance notes, to support day-to-day development and maintenance. [1] [2]

AI Agent Configuration

  • Introduced a new agents.yaml configuration for ChatTutorCrew with three agents: router_agent, translation_agent, and vocabulary_agent, each with detailed roles, goals, and backstories focused on language learning and tool integration.
  • Exported the ChatTutorCrew class in ai/src/crews/chat_tutor_crew/__init__.py for easier imports throughout the codebase.

Alexander Zarzhitski added 10 commits February 16, 2026 08:52
Implement AI-powered chat tutor for language learning with:
- Database: chats, chat_messages, and word_pairs tables with RLS
- Backend: ChatTutorCrew with router, translation, and vocabulary agents
- API: Chat endpoints for messaging, chat management, and history
- Frontend: Full chat UI with sidebar, messages, and adaptive components
- Features: Translation, vocabulary suggestions, domain boundary enforcement

The chat agent responds to language-learning queries only and
politely declines off-topic requests. Structured responses enable
adaptive UI rendering for word suggestions and save confirmations.
Enhanced CLAUDE.md and AGENTS.md with:
- Complete project structure and architecture overview
- All API endpoints documented with examples
- CrewAI agent patterns and configuration
- Database schema and security notes
- Frontend components, hooks, and dependencies
- Debugging guide with common issues and solutions
- Performance considerations and caching strategies
- Environment configuration for all services
- Agent-specific instructions for adding new crews

This provides comprehensive reference documentation for
future development and onboarding.
Implement complete flashcard management system with:
- Backend API endpoints for word_pairs CRUD operations
- Frontend flashcards page with list and study mode views
- Interactive flashcard cards with flip animation
- Study mode with progress tracking and navigation
- Flashcard management (view, delete, study)
- Navigation integration in sidebar

Features:
- My Flashcards tab: View saved vocabulary pairs with translations
- Study Mode tab: Interactive flip card study sessions
- Mark as Learned functionality to track progress
- Progress bar showing completion percentage
- Empty states with CTAs to start chatting
- Flashcard deletion with confirmation

The word_pairs table was created with the chat feature;
this adds the UI and additional endpoints for full flashcard management.
Add documentation for using host.docker.internal when running
the web container in Docker. This fixes connection issues
where containers can't reach Supabase or AI service on 127.0.0.1.
- Replace non-existent IconBookOpen with IconBook
- Replace non-existent IconRotateCw with IconRefresh
- Replace non-existent IconGraduationCap with IconSchool
- Add host.docker.internal to Vite allowedHosts for Docker browser access
- Add CrewAI tool definition for save_word_pair in tools.py
- Integrate tool into translation_agent and vocabulary_agent
- Pass user_id context to crew execution for tool access
- Update agent backstories to mention save_word_pair capability
- Enhance tool handling in run.py to inject user_id into tool calls

The tool allows agents to save word pairs directly to the user's
flashcard deck with duplicate detection and context sentence support.
- Add PUT /api/chats/<chat_id> endpoint to update chat title
- Add renameChat function to ai-service.ts
- Add renameChat to use-chat hook with optimistic update
- Add inline edit UI to ChatSidebar with double-click to edit
- Add keyboard shortcuts (Enter to save, Escape to cancel)

Users can now rename their chats by double-clicking on the chat
title or clicking the rename icon in the sidebar.
- Add RoutingDecision schema to capture router's agent selection
- Create separate tasks for translation and vocabulary specialists
- Implement conditional routing in run.py to execute specialist crews
- Update task descriptions with proper response_type values
- Add Crew and Process imports for hierarchical crew execution

The router agent now analyzes user messages and delegates to:
- Translation Specialist: For translation requests and grammar questions
- Vocabulary Specialist: For new vocabulary word suggestions

Phoenix traces show clear delegation pattern with separate
spans for router decision and specialist execution.
- Clean up unused Crew, Process imports from run.py
- Callback routing in crew.py creates single trace showing router → specialist chain
- Agents now execute sequentially in one crew instance instead of separate instances
- Change buttons from hidden to always visible (50% opacity)
- Move Rename and Delete buttons to beginning of row
- Buttons become fully visible on hover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant