How shubham-rasal/hashmind works
Project Type & Purpose
• HashMind is a full-stack decentralized application that integrates AI agents, blockchain smart contracts, Web3 authentication, and decentralized messaging.
• Its goal is to let users create and deploy specialized AI agents (for finance-related services) by interacting with a chat interface and integrating various blockchain and messaging components.
Key Components
a. Frontend/UI Components:
• Two Next.js-based frontends located under the “dashboard” and “frontend” folders.
• These likely serve different user interfaces (the dashboard for agent management and another client-facing experience for interacting with AI agents).
b. Backend Services:
• The “backend” contains a Node.js/Express-based server for handling API calls, including integration with Lit Protocol for encryption and secure data handling.
• The “message-kit” module is a specialized service packaging XMTP chat functionalities that connect with a Redis database for message logging and management.
c. Smart Contracts/Blockchain Layer:
• The “contracts” directory holds Hardhat configurations, Solidity contracts (including a Galadriel factory contract for agent creation), and deployment scripts. This represents the blockchain layer and smart contract interactions.
d. External/Third-Party Services:
• XMTP Chat Interface for facilitating bot interactions.
• Hedera Consensus Service that provides distributed decision-making for agent operations.
• Web3Auth for user authentication (onboarding via familiar Web2 providers while connecting wallet interactions).
• Lit Protocol for decentralized encryption and fine-grained access control.
Relationships & Interactions
• The Frontends (both dashboard and client-side interfaces) interact with:
• The backend server via API calls to handle operations like agent creation, user authentication, and secure data handling.
• External services for real-time messaging (XMTP through message-kit) and user verification.
• The Backend:
• Acts as an orchestrator by taking requests from the UI and communicating with blockchain smart contracts for agent creation and other operations.
• Interfaces with the Lit Protocol for encryption/decryption tasks.
• Smart Contracts:
• Deployed by the contracts directory’s scripts and used by the backend to create and manage “agents” through the Galadriel factory contract.
• Message-Kit:
• Functions as an independent service/module that integrates with XMTP for chat-based agent interactions, supported by Redis for caching or logging.
• External APIs/Third-Party Integrations (XMTP, Hedera, Web3Auth):
• These services are critical for real-time communication, decentralized consensus, and secure user onboarding.
Architectural Patterns & Design Principles
• Separation of Concerns: Clearly delineate between the presentation layer (frontends), business logic/API layer (backend), blockchain operations (smart contracts), and messaging service (message-kit).
• Integration with External Systems: Show how components interact with third-party services (XMTP, Hedera, Web3Auth, Lit Protocol).
Detail Level
• Provide enough detail to capture all core interactions without oversimplification – the goal is to cover data flows and interactions between “Dashboard”, “Frontend”, “Backend”, “Smart Contract Layer”, “Message-Kit”, and various external integrations.
• Don’t shy away from breaking down modules further if needed (for instance, show that the Message-Kit internally interacts with both Redis and XMTP).