Quick Start Guide
Walks through installing dependencies, creating Supabase tables, and configuring API keys for a multi-agent AI assistant.
What this file does
Walks through installing dependencies, creating Supabase tables, and configuring API keys for a multi-agent AI assistant.
When to use it
- Setting up a NEXUS-based AI assistant from scratch
- Deploying a Telegram bot with Redis and Supabase backend
- Configuring API keys for OpenRouter, Gemini, Tavily, and others
Assumes this stack
""" NEXUS Setup Instructions """
Quick Start Guide
Prerequisites
- Python 3.12+
- Redis (for short-term memory)
- Supabase account
- API keys for: OpenRouter, Telegram, Gemini, GitHub, Tavily
Step-by-Step Setup
1. Environment Setup
cd /path/to/nexus
cp .env.example .env
# Edit .env with your actual API keys
2. Python Dependencies
pip install -r requirements.txt
playwright install chromium
3. Database Setup
Supabase Tables
Create these tables in your Supabase project:
memories (for long-term memory)
create table memories (
id bigserial primary key,
content text,
metadata jsonb,
embedding vector(32),
created_at timestamp default now()
);
create index on memories using ivfflat (embedding vector_cosine_ops);
clients (for client management)
create table clients (
id bigserial primary key,
name text,
email text unique,
phone text,
company text,
created_at timestamp default now()
);
tasks (for task management)
create table tasks (
id bigserial primary key,
title text,
description text,
status text default 'pending',
priority int default 1,
created_at timestamp default now(),
due_date timestamp
);
events (for calendar)
create table events (
id bigserial primary key,
title text,
description text,
start_time timestamp,
end_time timestamp,
attendees text[],
created_at timestamp default now()
);
revenue (for tracking)
create table revenue (
id bigserial primary key,
amount float,
source text,
description text,
date timestamp default now()
);
4. Redis Setup
# Option 1: Using Docker
docker run -d -p 6379:6379 redis:7-alpine
# Option 2: Using Homebrew (macOS)
brew install redis
redis-server
5. Telegram Bot Setup
- Go to @BotFather on Telegram
- Create a new bot: /newbot
- Copy the token to .env as TELEGRAM_BOT_TOKEN
- Get your user ID: @userinfobot
- Copy to .env as TELEGRAM_CHAT_ID
6. API Keys
- OpenRouter: Get from openrouter.ai
- Gemini: Get from Google AI Studio
- Tavily: Get from tavily.com
- Anthropic: Get from console.anthropic.com
- GitHub: Personal access token from github.com/settings/tokens
- Vercel: Token from vercel.com/account/tokens
- Supabase: Project API keys from supabase dashboard
Testing
Test Agent
python -c "
import asyncio
from agent.core import nexus_core
result = asyncio.run(nexus_core.process_message('Hello NEXUS'))
print(result)
"
Test Tools
# Test web search
python -c "
import asyncio
from tools.search import web_search
result = asyncio.run(web_search('Python async tutorials'))
print(result)
"
Running NEXUS
Development
python main.py
Production with Docker
docker-compose up -d
docker-compose logs -f nexus
Monitoring
Telegram Commands
/start - Initialize NEXUS
/help - Show help
/status - System status
/tasks - Pending tasks
/revenue - Revenue summary
Log Files
tail -f nexus.log
Redis
redis-cli
> KEYS session:*
> LRANGE session:session_123:messages 0 -1
Troubleshooting
Can't connect to Redis
# Check if Redis is running
redis-cli ping
# Should return: PONG
Supabase connection error
- Verify SUPABASE_URL and SUPABASE_KEY in .env
- Check network connectivity
- Verify tables exist in Supabase
Telegram bot not responding
- Verify TELEGRAM_BOT_TOKEN is correct
- Check Telegram API status
- Ensure chat_id is numeric
API key errors
- Check all API keys in .env
- Verify keys have correct permissions
- Ensure keys are not expired
Performance Tuning
Redis Optimization
# Increase max clients
redis-cli CONFIG SET maxclients 10000
# Monitor performance
redis-cli MONITOR
Model Selection
For faster responses, use smaller models:
- Simple tasks: Gemini 2.5-flash
- Research: GLM-5
- Complex: minimax-m2.5
Security Checklist
- .env file is in .gitignore
- API keys are revoked if exposed
- Run on HTTPS only
- Use strong Redis password
- Enable Supabase RLS policies
- Telegram bot token is secure
Next Steps
- Configure your first scheduled task
- Add custom tools
- Set up monitoring/alerts
- Deploy to production
- Integrate with your business systems
For detailed documentation, see README.md
What's inside
13 sections, 5 SQL table definitions, 6 API key instructions, 3 test commands, 1 security checklist
Change this for your project
- Replace
anasanrai/NEXUSwith your own repository name - Replace
/path/to/nexuswith your actual project directory - Replace
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_IDwith your own bot token and user ID - Replace all placeholder API keys in
.envwith your own keys
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Storing long-term memory in a vector-enabled Supabase table for semantic search
- Using a single
.envfile to centralize all API keys and configuration - Providing both development and production (Docker) run commands in the same guide
Related Documents
Setup & Deployment Checklist
Guides you through 10 phases to set up, test, deploy, and customize a content agent system using OpenRouter and Streamlit.
RealDiag Demo Video Script
Provides a complete 5-7 minute demo video script for a clinical decision support tool, including timing, visual cues, and production notes.
š± Mobile Phone Preview - Quick Start
Walks you through four ways to preview a React Native Expo app on real devices and emulators, plus a testing checklist and troubleshooting guide.
š Sleepy Storybook ā Launch Marketing Plan
Outlines an 18-day launch plan for a personalized AI bedtime story app, covering social media, influencer outreach, paid ads, and email sequences.