Overview
This guide will help you run the complete MetaVault AI stack locally, including:- Local blockchain with deployed smart contracts
- AI agent server for vault management
- Next.js frontend for user interaction
Running the Full Stack
Start Smart Contracts
Navigate to the contracts directory and start a local Hardhat node:First, compile the smart contracts:Then start the local blockchain:
Keep this terminal window open. The local blockchain will run on
http://127.0.0.1:8545Configure AI Agents
Set up the environment for the AI agents:Edit the
.env file and add your configuration. See the Configuration guide for details.At minimum, you need to configure:
OPEN_ROUTER_KEY- Your OpenRouter API keyVAULT_ADDRESS- From the deployment outputRPC_URL- Set tohttp://127.0.0.1:8545
Start AI Agent Server
Run the agent server:The agent server will start and be available for the frontend to communicate with.
Configure Frontend
Set up the environment for the frontend:Update the
.env.local file with the contract addresses from Step 2:Start Frontend
Launch the Next.js development server:Open http://localhost:3000 in your browser to access MetaVault AI.
Quick Start with All Services
Alternatively, you can start all services at once from the root directory:- Local Hardhat node (contracts)
- AI agent server
- Next.js frontend
Verify Everything is Running
Confirm that all services are operational:Check Blockchain
Check Blockchain
Your Hardhat node terminal should show:
Check AI Agents
Check AI Agents
The agent server should be listening on the configured port (default: 3001):
Check Frontend
Check Frontend
The Next.js server should display:
Connect Your Wallet
To interact with MetaVault AI:-
Open MetaMask and add the local Hardhat network:
- Network Name:
Hardhat Local - RPC URL:
http://127.0.0.1:8545 - Chain ID:
31337 - Currency Symbol:
ETH
- Network Name:
- Import one of the test accounts from the Hardhat node output (it provides 20 pre-funded accounts)
- Connect your wallet on the MetaVault AI frontend
Next Steps
Configuration Guide
Detailed configuration options for all packages
Architecture
Learn about MetaVault AI’s system architecture
AI Agents
Explore the AI agents that manage your vault
Smart Contracts
Understand the vault’s smart contract system