Skip to content

Conversation

@rixitgithub
Copy link
Contributor

Implemented AI Debate Coach with Weak Statement Strengthening Feature

Description

This pull request introduces the AI Debate Coach to DebateAI, enhancing the platform with independent learning capabilities. A key feature allows the coach to present a weak debate statement, prompt the user to strengthen it, and evaluate the improved argument, providing feedback and a score. This implementation empowers users to practice and refine their debate skills autonomously, aligning with the goal of fostering self-directed learning.

Context

This PR addresses the issue "Enhance Independent Learning Skills with AI Debate Coach Integration" (#74). The AI Debate Coach leverages DebateAI’s existing infrastructure (LLMs, WebSockets, etc.) to provide a seamless, interactive experience. The implemented feature—weak statement strengthening—serves as the foundation for future coach enhancements, such as real-time guidance and practice simulations.

Changes Made

  • Frontend:
    • Added StrengthenArgument component (src/components/StrengthenArgument.tsx):
      • Users select a topic and stance, receive a weak statement from the coach, input their strengthened argument, and view feedback with an animated score.
      • Integrated with a step-based UI (Choose Topic → Strengthen Argument → View Feedback).
      • Updated CoachPage (src/components/CoachPage.tsx) to link to /coach/strengthen-argument.
    • Enhanced UI with notifications, error handling, and a progress indicator.
  • Backend:
    • Implemented services/coach.go:
      • GenerateWeakStatement: Uses Gemini LLM to create a weak statement based on topic and stance.
      • EvaluateArgument: Evaluates the user’s strengthened argument, returning feedback and a score (0-10).
      • UpdateUserPoints: Increments user points in MongoDB based on evaluation.
    • Added routes/coach.go:
      • GET /coach/strengthen-argument/weak-statement: Endpoint to fetch a weak statement.
      • POST /coach/strengthen-argument/evaluate: Endpoint to evaluate the user’s response and update points.
  • Integration:
    • Connected frontend API calls to backend endpoints using authentication tokens (getAuthToken).
    • Ensured real-time feedback delivery via fetch requests.

Video

A short demo video showcasing the AI Debate Coach in action is available here:

coach_argument.mp4

📸 Screenshots

Step Description Screenshot
1️⃣ Choose Topic Step 1
2️⃣ Write a Weak Statement Step 2
3️⃣ Strengthen the Argument Step 3
💬 Feedback Dialog Feedback
🧠 Coach Page Entry Point Coach Page

Reviewers

Additional Notes

  • Dependencies: Requires the Gemini API key to be configured in the backend environment.
  • Future Work: This PR lays the groundwork for additional AI Debate Coach features (e.g., real-time guidance, practice simulations). A follow-up PR will address unit tests and edge-case handling.
  • Testing: Tested locally with http://localhost:1313. Ensure backend server is running and MongoDB is connected before testing.
  • Feedback: Open to suggestions on UI polish or backend optimization!

Closes

Closes #74


Zahnentferner and others added 25 commits December 3, 2024 10:38
…-Hide-Password-Functionality-46

password hide-visible feature added ( issue AOSSIE-Org#46 )
…DebateAI

- Added seamless post-sign-in user flow with navigation logic in React
- Implemented profile UI and /user backend routes with edit functionality
- Built leaderboard UI and /leaderboard API, sorting users by EloRating
- Created user and debate schemas in MongoDB with Go integration
- Seeded test data; updated config, auth, and dependencies for full stack support
…es and AI judgment using WebSocket and WebRTC
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.

Enhance Independent Learning Skills with AI Debate Coach Integration

8 participants