πŸ“¦Installation

Complete guide to installing and setting up Somnia Agent Kit.

πŸ“‹ Prerequisites

Before installing, ensure you have:

  • βœ… Node.js 18+ installed (Downloadarrow-up-right)

  • βœ… npm, pnpm, or yarn package manager

  • βœ… Git for cloning repositories

  • βœ… Code editor (VS Code recommended)

Check Your Environment

# Check Node.js version
node --version
# Should be v18.0.0 or higher

# Check npm version
npm --version

# Check Git
git --version

πŸš€ Installation Methods

Install the published package from npm:

Method 2: From Source

Clone and build from the repository:

βš™οΈ Environment Setup

Step 1: Create Environment File

Create a .env file in your project root:

Step 2: Configure Environment Variables

Add the following to your .env file:

circle-exclamation

Step 3: Get Testnet Tokens

You need testnet tokens to interact with smart contracts:

  1. Get a Wallet Address

  2. Visit Somnia Faucet

    • URL: https://faucet.somnia.network

    • Enter your wallet address

    • Request testnet tokens

    • Wait for confirmation

  3. Verify Balance

🧠 LLM Setup

Install Ollama:

Start Ollama:

Verify Installation:

Option 2: OpenAI

Get API Key:

  1. Visit https://platform.openai.com/api-keys

  2. Create new API key

  3. Copy and add to .env:

Test API Key:

Option 3: DeepSeek

Get API Key:

  1. Visit https://platform.deepseek.com

  2. Sign up and get API key

  3. Add to .env:

βœ… Verify Installation

Create a test file test-install.ts:

Run the test:

Expected Output:

πŸ“¦ Additional Dependencies

TypeScript Project Setup

If starting a new TypeScript project:

Recommended tsconfig.json:

Development Tools

🐳 Docker Setup (Optional)

If you prefer Docker:

Dockerfile:

docker-compose.yml:

Run with Docker:

πŸ”§ Troubleshooting

Issue: Module Not Found

Issue: TypeScript Errors

Issue: Network Connection Failed

Issue: Contract Not Found

Issue: Insufficient Funds

πŸ“š Next Steps

Now that you have Somnia Agent Kit installed:

  1. πŸ“– Read the Quick Start - quickstart.md

  2. πŸ—οΈ Understand Architecture - architecture.md

  3. πŸ’‘ Try Examples - examples/

  4. πŸ“Š Setup Monitoring - examples/monitoring.mdarrow-up-right

  5. πŸš€ Deploy to Production - deployment/production.mdarrow-up-right

πŸ†˜ Get Help

If you encounter issues:

  • πŸ“– Documentation: https://github.com/xuanbach0212/somnia-agent-kit/tree/main/docs

  • πŸ› GitHub Issues: https://github.com/xuanbach0212/somnia-agent-kit/issues

  • πŸ’¬ Discord: https://discord.gg/somnia

  • πŸ“§ Email: support@somnia.network

πŸŽ“ Learning Resources

  • Examples: https://github.com/xuanbach0212/somnia-agent-kit/tree/main/examples

  • API Reference: https://github.com/xuanbach0212/somnia-agent-kit/blob/main/API_REFERENCE.md

  • Video Tutorials: Coming soon

  • Blog Posts: Coming soon


Installation complete! πŸŽ‰ Ready to build your first AI agent? β†’ Quick Start Guide

Last updated