Back to .md Directory

Quick Start Guide

Walks through installing dependencies, creating Supabase tables, and configuring API keys for a multi-agent AI assistant.

May 2, 2026
0 downloads
0 views
ai agent gemini
View source

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

Python 3.12+RedisSupabaseDockerPlaywrightTelegram Bot API

""" 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

  1. Go to @BotFather on Telegram
  2. Create a new bot: /newbot
  3. Copy the token to .env as TELEGRAM_BOT_TOKEN
  4. Get your user ID: @userinfobot
  5. 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

  1. Configure your first scheduled task
  2. Add custom tools
  3. Set up monitoring/alerts
  4. Deploy to production
  5. 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/NEXUS with your own repository name
  • Replace /path/to/nexus with your actual project directory
  • Replace TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID with your own bot token and user ID
  • Replace all placeholder API keys in .env with 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 .env file to centralize all API keys and configuration
  • Providing both development and production (Docker) run commands in the same guide

Related Documents