samueldanso / zeroAI-muaccra

ZeroAI – Built for the MuAccra 2024 hackathon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZeroAI

Making Information Accessible Anywhere, for Everyone with Zero Internet

Demo | Docs

Overview

ZeroAI is a decentralized solution that provides offline access to AI agents, empowering millions of users in remote or underserved areas with limited internet connectivity to access vital information and knowledge via SMS and voice. It leverages Filecoin for secure storage, NFTs for content access, and integrates with The Graph for reliable data management and connectivity.

Features

  • User-Friendly SMS Chats : Easily ask questions and receive intelligent answers via text messages.
  • Offline AI Access: AI agents provide responses via SMS, even without the internet.
  • Decentralized Marketplace: Securely publish and share AI-driven content using Filecoin for storage.
  • Decentralized Storage: Content is securely stored on Filecoin for decentralized management.
  • Secure Data Access: Uses NFT contracts to ensure only authorized users can access and decrypt data.
  • Simple Addressing: Access AI agents via short, memorable names (ENS names) or phone numbers.
  • Monetization for Content Creators: Enables creators to monetize their data by publishing content on the marketplace and securing it with NFTs.

Tech Stack

  • Solidity: Smart contract language for the ZeroAI platform.
  • Hardhat: Development environment for smart contracts.
  • Lit Protocol: Lit is an internet native security and identity network.
  • Filecoin: Secure storage for AI content.
  • The Graph: Decentralized data management and querying.
  • Apollo Client: GraphQL client for the ZeroAI platform.
  • Express: Server-side framework for the ZeroAI platform.
  • React: Frontend framework for user interfaces.
  • Next.js: React framework for server-side rendering.
  • Tailwind CSS: CSS framework for styling.
  • Chakra UI: UI framework for the ZeroAI interface.
  • Langchain: Framework for language model management.
  • OpenAI: AI language model platform.
  • Stability AI: AI platform for the image generation.
  • Twilio: Communication API platform for the SMS messaging.

How it Works

  1. Content Publishing and Storage:

    • Decentralized Marketplace: Creators publish content on the ZeroAI marketplace, stored securely on Filecoin.
    • NFT Integration: Each content piece is linked to an NFT, ensuring only NFT holders can decrypt and access it via the Lit Protocol.
  2. AI Agents and Content Consumption:

    • Vectorization and Embedding: AI agents access, vectorize, and embed published content into their knowledge bases for intelligent responses.
    • IPNS and FVM Logging: AI agents update knowledge base pointers using IPNS and log indexed vector hashes on a smart contract on the Filecoin Virtual Machine (FVM).
  3. User Interaction via SMS:

    • SMS Queries: Users interact with AI agents by sending queries via SMS through Twilio to the ZeroAI backend.
    • Simple Addressing: AI agents are accessible through short names (ENS names) or phone numbers.
  4. Backend Processing and AI Responses:

    • Query Handling: The backend matches user queries with the appropriate AI agent, which performs similarity checks with its knowledge base.
    • Response Generation: The AI agent generates and sends a natural language response to the user via SMS.
  5. Data Management and Security:

    • Secure Storage: Data, including content and user interactions, is securely stored on Filecoin.
    • NFT-based Access Control: NFTs ensure only authorized users can access and decrypt content.

Contracts

Contract Description
AgentFactory.sol Deploys a new AI agent by cloning the AgentTemplate.sol.
AgentTemplate.sol The base contract for creating AI agents.
NFTFactory.sol Deploys new NFTs used to token-gate datasets. AI agents can consume these datasets after minting/paying for the NFTs.
PayableNFT.sol NFT Contract representing a published data. It is used as an access condition while encrypting documents with Lit Protocol. So users can get access to an AI by paying and minting an NFT from the contract.

Getting Started

  1. Clone the repository:
git clone https://github.com/samueldanso/zeroai-muaccra.git
cd zeroai-muaccra
  1. Install the dependencies:
cd backend
pnpm install
cd ../ui
pnpm install
cd subgraph
pnpm install
  1. Configure the environment variables:
cd contracts
cp .env.example .env
cd ../ui
cp .env.example .env
  1. Compile the smart contracts:
cd contracts
npx hardhat compile
  1. Deploy the smart contracts to Sepolia testnet:
cd contracts
npx hardhat run scripts/deploy.js --network sepolia
  1. Start the backend server:
cd backend
pnpm start
  1. Run the app:
cd ui
pnpm run dev

Open your browser and navigate to http://localhost:3000 to access the ZeroAI interface.

Contributing

We welcome contributions to the ZeroAI project. If you have any ideas or suggestions for improving the project, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

ZeroAI – Built for the MuAccra 2024 hackathon

License:MIT License


Languages

Language:TypeScript 87.7%Language:JavaScript 11.1%Language:Solidity 1.1%Language:CSS 0.1%