
XMTP LexiPal
Your friendly AI language coach
Demo
About
The problem it solves ## The Problem Many people start learning languages and would like to expand on their vocabulary, but struggle to stay motivated and consistent. It's especially difficulty when learning alone. Without external accountability, it’s easy to lose momentum. * Most goal setting app rely on **self-reported progress**, which is unverifiable and doesn’t drive true accountability. * Many vocal building apps use **static question banks** that can be easily gamed — learners, especially younger kids, may choose to guess the answer or game the system without true mastery. * Generic AI chatbots provide interesting conversation, but lack **structured learning paths** and measurable progress, and there's **no real stake in the line** to keep people motivated. ## Our Solution What if you could stake ETH to create a language learning goal, and an **AI agent tracks your progress **and have full control over **whether you can get your stake back**? We introduce structured vocab goals: target number of words, difficulty level, and completion deadline. The agent will help **suggest a goal** for you to confirm. You won’t just click buttons and there's no shortcuts. The AI will test you in a free-form quiz by: 1. Asking you to define the word 2. Asking you to use it in a sentence 3. Generating multiple choice options in real time for you to select from AI will decide whether you’ve mastered the word and provide feedbacks, and the AI is the sole entity that may update your word progress on-chain. You interact with the AI via **XMTP protocol** , each learning conversation happens via the messaging protocol. Behind the scenes, each conversation creates a dedicated wallet (via CDP agent kit), enabling the AI to update your learning progress, word by word. (The AI will ask you for some gas fund to get started) If you **complete your goal**, you can claim your full stake back. If you fail, you can only claim a **partial refund** based on your progress, and the remaining stake will be sent to a public reward pool contract that can be used for future community learning events and incentives. Leaners can also create a study group through our site — an XMTP group chat where a special group learning agent is auto-invited to make the learning experience more fun. The group agent is a separate agent and is still under development, and for now there is no on-chain component in the group chat, but it allows learners to engage together and stay motivated. A potential use case: parents can stake ETH and set up a learning goal for their child , this will help helping **onboard younger generations on-chain**, giving them a fun and structured way to earn rewards through real effort. ## Highlights - We've integrated XMTP in our own frontend for best accessibility and customization. There's a bit of a hurdle with working with the xmtp browser-sdk since v3 is relatively new. - On-chain progress is seamlessly integrated and displayed alongside with the chat. - Basename integrated ## Tech Stack & Tools - XMTP protocol for messaging - Coinbase AI agent kit & OpenAI API for the chat agent and agent wallet - Next Js for Frontend (integrated with XMTP browser SDK) - Solidity/Hardhat for smart contract - Subgraph for indexing - GCP for agent hosting & Vercel for frontend hosting - Rainbowkit for Wallet Connection - BaseName Integrated - Live on Base Mainnet --- The project is live on https://xmtp-lexi-pal.vercel.app/ (If you have issue messaging try starting with a fresh wallet.)
How it's made
Challenges we ran into ## Custom Frontend Integrating with XMTP V3 The V3 update turned cursor into a curse. It took me a good chunk of time to read the documentation to figure out the right way to integrate a custom frontend that transmit and receive message via the XMTP protocol properly. One tricky issue that cost me a great deal of time is that in V2 user identifier is simply the address, in V3 the user identify involves the address and client.create() actually could take a chainID behind the hood, which is immutable, meaning you can't create another identify with same wallet and different chainId, it **will cause issue if you login with another chainID**. The XMPT.chat app create identify with **chainID=0** by default, and if I login in my custom frontend with that wallet assuming **chainI=1**, it will show the other recipient as reachable but fail silently while creating a DM and and throw and seemingly irrelevant error when sending msg **(InboxValidationError)**. Also ran into issue with conversation syncing when I ran two instance of the server with same identity during testing for having two copies of local database. ## Wiring all the stuff together The project uses a good mix of tools and technologies, wiring them all together seamlessly can be challenge as a solo developer who were starting from scratch during the hackathon There's a slight delay in chat sending and I ran into some issue with using **sendOptimistic()**, will look into this later. ## The Quiz logic and Security To ensure the user can't possibly convince the AI to update their word progress without actually taking the quiz. We do switch between full agent mode and "semi agent mode" where we run some logical check before allowing agent to make update.