DeChat is a native AI assistant for the Sonic blockchain that allows users to interact with DeFi protocols, manage assets, and bridge tokens across chains using simple conversational commands.
Live Site: dechat.cc
- Sonic Native Assistant: Purpose-built AI assistant for Sonic blockchain
- DeFi Automation: Stake, swap, transfer, and manage assets with simple commands
- Wallet Integration: Secure wallet connection via Privy
- AI-Powered Chat: Natural language interface for blockchain interactions
DeChat is built as a full-stack application with separate frontend and backend components:
- Next.js application with React for the user interface
- Privy integration for wallet connection and authentication
- Node.js/Express server handling API requests
- MongoDB database for storing user data and chat threads
- Integration with OpenAI for natural language processing
The core of DeChat's blockchain interaction is powered by the custom de-agent package:
- Agent: Core DeAgent class that handles blockchain interactions and transaction signing
- Actions: Predefined blockchain operations (40+ actions) including:
- Sonic token transfers and balance checks
- Staking and unstaking operations
- Cross-chain bridging via deBridge
- Price data via Chainlink integration
- Token swaps and trading
- Tools: AI-compatible tools that wrap actions for natural language processing
- Constants: Token definitions and configuration defaults
The DeAgent connects to the Sonic blockchain via RPC and uses Privy for secure transaction signing, enabling the AI assistant to perform blockchain operations on behalf of users through conversational commands.
- Node.js (v18 or later)
- pnpm
- MongoDB instance
- OpenAI API key
- Privy account and credentials
-
Clone the repository:
git clone https://github.com/aryan877/deChat.git cd deChat -
Install dependencies:
pnpm install -
Set up environment variables:
- Copy
.env.exampleto.envin bothapps/webandapps/serverdirectories - Fill in the required values (API keys, database URIs, etc.)
- Copy
-
Run the development server:
pnpm dev