project screenshot 1
project screenshot 2
project screenshot 3

Sim AI

Sim AI - An 3d game where there are multiple NPCs AI Agents.. It is a 3D game where player can make their own dream class with their favourite teachers and students type.

Sim AI

Created At

ETHOnline 2024

Project Description

Project Overview: AI-Powered Classroom with Galadriel This project reimagines education by building a decentralized, AI-powered classroom where users (students) can interact with AI agents (teachers) to receive lessons, ask questions, and receive feedback in real-time, all on-chain. The system leverages Galadriel’s large language model (LLM) capabilities, paired with blockchain technology, to create a seamless, decentralized learning environment. The project also integrates with Metamask to handle transactions and interactions securely on the blockchain.

Core Components: Decentralized Classroom: The classroom operates on a smart contract deployed on-chain, with interactions between AI agents (teachers and students) taking place through Galadriel’s LLM. The classroom allows students to ask questions and receive structured lessons, with feedback provided by AI teachers. This interaction is decentralized, ensuring transparency, security, and immutable records of all student-teacher interactions.

AI-Driven Teacher and Student Agents: Each user (student or teacher) interacts with the system through AI agents powered by Galadriel's LLM. The agents are responsible for:

Teachers: Providing lessons, answering questions, and offering detailed grammar breakdowns or feedback based on student inputs. Students: Asking questions and receiving personalized lessons based on their queries. On-Chain Interaction with Galadriel: The backend of the project includes a series of smart contracts that manage interactions between students and teachers. These smart contracts handle lesson requests, AI-generated responses, and store feedback data on-chain. The use of Galadriel’s oracle system ensures the interaction between blockchain and AI models happens smoothly and securely.

Metamask Integration for Transactions: Each interaction, such as a student asking a question or a teacher providing feedback, is a transaction on-chain. Metamask is used to authenticate users and process these transactions, ensuring security and transparency. This system guarantees that all classroom interactions are verifiable on the blockchain.

How it's Made

  1. Galadriel for AI Language Models What it does: Galadriel’s powerful on-chain AI agents are the core of this project. We built decentralized AI teacher agents capable of answering student queries, generating structured lessons, and offering feedback—all in real-time, stored on the blockchain. How it's used: We deployed Galadriel’s LLMs (large language models) via smart contracts, where every user interaction (a question or feedback request) triggers an on-chain call to Galadriel's oracle, executing AI-driven logic on-chain. Why it’s important: Galadriel gives us the power to combine sophisticated natural language processing with decentralized computation, allowing for verifiable AI interactions stored immutably on the blockchain.
  2. Solidity Smart Contracts for Managing AI Agents What it does: The heart of the project is a series of Solidity smart contracts that define and manage interactions between students and teachers (AI agents). Each contract is responsible for handling input from the frontend (user queries) and passing that to the Galadriel oracle for processing. Key contract components: AI Teacher Agent: Responsible for providing structured lessons and explanations based on student queries. AI Student Agent: Enables students to ask questions and get personalized answers and feedback. Oracle Communication: Contracts handle input/output to the Galadriel oracle, allowing agents to execute queries and return responses from the AI model. Why it’s important: Using smart contracts ensures that every interaction is trustless, transparent, and verifiable on-chain. The contract-based design allows for decentralized ownership and operation of the classroom, with immutable records of all interactions.
  3. Frontend with React, Zustand, and Ethers.js React: The frontend is built in React, providing a flexible and modular way to handle the user interface. Each component (e.g., typing box, chat history) is reactive and dynamically updates as interactions occur between the user and AI agents. Zustand for State Management: Zustand is used to manage the state of the classroom, handling AI agent data, user input, and managing loading states. It provides a simple but powerful way to store the conversation history and manage the switching between agents (e.g., from a teacher agent to a feedback agent). Ethers.js for Blockchain Interaction: We use Ethers.js to connect the frontend to the Ethereum blockchain. Users authenticate via MetaMask, and all interactions (questions, feedback, etc.) are executed as blockchain transactions, making use of the deployed smart contracts.
  4. MetaMask for Web3 Authentication and Transactions What it does: MetaMask is used to securely authenticate users and allow them to interact with the blockchain-based classroom. Each time a user asks a question, the transaction is processed through MetaMask, ensuring secure and decentralized interactions. How it's used: When a student inputs a question, MetaMask pops up to confirm the transaction, and the data is sent on-chain to the teacher agent. The results of the query are then fetched and displayed in the user interface. Why it’s important: MetaMask provides an easy-to-use and familiar gateway for users to interact with the decentralized classroom, bridging the gap between Web2-style interaction and Web3 security and decentralization.
  5. IPFS for Decentralized Data Storage What it does: Lessons and user-generated content (e.g., feedback) are stored in a decentralized manner using IPFS (InterPlanetary File System). This ensures that all educational content is distributed and available off-chain, with data securely stored in a decentralized network. Why it’s important: Using IPFS ensures that the educational content is not centralized on any single server but is distributed across a decentralized network, improving security, availability, and transparency.
  6. Hacky but Effective Solutions MetaMask Transaction Triggering: One of the unique challenges was handling the frequent interaction between students and teachers without overwhelming the blockchain with too many transactions. To solve this, we implemented batching of messages and optimized transaction calls to ensure smooth communication without unnecessary gas costs. On-Chain Feedback Loop: The feedback process between students and AI teachers is managed entirely on-chain, meaning that every single query, feedback, and follow-up is recorded and verified on the blockchain. This required a complex series of calls between the frontend, the smart contracts, and Galadriel’s AI models, ensuring that the process remains decentralized while still performant. Technologies Used: Galadriel Platform: The core AI engine for language processing. Solidity: Smart contract development for on-chain logic and interaction with Galadriel oracles. MetaMask: Web3 wallet for transaction handling and user authentication. React: Frontend framework for building the user interface. Zustand: State management for the frontend application. Ethers.js: Blockchain interaction and transaction management. IPFS: Decentralized storage for lesson content and feedback.
background image mobile

Join the mailing list

Get the latest news and updates