Skip to content

kvkdsg/Agentes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

101 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agents boton.ONE

Agents boton.ONE is an AI voice agents platform for building, deploying, and operating real-time conversational agents across web and telephony. It combines a Next.js 15 application, a domain-driven feature structure, Gemini Live integrations, Telnyx telephony flows, built-in RAG with pgvector, multi-workspace billing, and security guardrails for production-oriented SaaS use cases.

Features

  • Real-time voice flows with streaming and multimodal interaction.
  • Telephony support for inbound calls, outbound calls, number provisioning, and human handoff.
  • Native RAG pipeline with document ingestion, OCR support, embeddings, and semantic retrieval.
  • Google Calendar integration for availability checks and event creation.
  • SaaS billing model with subscriptions, credits, usage tracking, and role-based access.
  • Security layers for prompt injection protection, PII masking, encryption, CSRF, and rate limiting.
  • Embedded widget support for public agent sessions.
  • Observability, structured logging, and AI evaluation suites.

Tech stack

Frontend

  • Next.js 16
  • React 19
  • TypeScript
  • App Router
  • Tailwind CSS 4
  • Framer Motion
  • Shadcn UI
  • next-intl

Backend

  • Next.js Route Handlers
  • PostgreSQL
  • pgvector
  • Prisma
  • Better Auth
  • @google/genai
  • Telnyx API
  • Stripe
  • Upstash Redis
  • Google Cloud Storage
  • Google Cloud Tasks

Tooling

  • Vitest
  • OpenTelemetry
  • Pino
  • Biome
  • Docker
  • Google Cloud Build

Project structure

src/
├── app/                    # App Router pages, localized routes, API handlers and webhooks
├── components/             # Shared UI components
├── evals/                  # AI evaluation datasets and runners
├── features/
│   ├── agent-setup/        # Agent creation flows and prompt generation
│   ├── agents/             # Agent management, playground and runtime logic
│   ├── auth/               # Authentication, session UI and WS auth
│   ├── billing/            # Plans, subscriptions, credits and usage ingestion
│   ├── calendar/           # Google Calendar integration and rate limits
│   ├── chat/               # Chat orchestration and multimodal runtime
│   ├── embed/              # Public widget and embedded sessions
│   ├── gemini-live/        # Real-time voice and Gemini Live integration
│   ├── marketing/          # Landing page and public marketing site
│   ├── oauth/              # OAuth callback and token flows
│   ├── rag/                # Knowledge bases, ingestion, chunking and retrieval
│   ├── telephony/          # Telnyx, phone numbers, calls and webhooks
│   ├── tools/              # Tool execution and function calling
│   ├── webmcp/             # MCP-related runtime integration
│   └── workspaces/         # Multi-tenant workspace logic
├── i18n/                   # Internationalization config
├── messages/               # Locale dictionaries
├── scripts/                # Cache and operational utility scripts
├── server/                 # Env config, DB, security and observability
├── shared/                 # Cross-cutting utilities, hooks and schemas
└── types/                  # Shared global types

Requirements

  • Node.js 24.15.0
  • pnpm 10.x
  • PostgreSQL 17+ with pgvector
  • Redis or Upstash Redis
  • External credentials for Gemini, GCP, Telnyx, Stripe, and Google OAuth depending on which features you want to enable

Installation

git clone https://github.com/kvkdsg/Agentes
cd agentes
corepack enable
pnpm install

Environment variables

Create a .env file in the project root:

DATABASE_URL="postgresql://user:pass@localhost:5432/agents_saas?schema=public"
APP_URL="http://localhost:3000"
JWT_SECRET="replace-with-a-long-random-secret"
BETTER_AUTH_SECRET="replace-with-a-long-random-secret"
INTERNAL_API_SECRET="replace-with-a-long-random-secret"
APP_ENCRYPTION_KEY="primary:replace-with-base64-aes-256-key"

GEMINI_API_KEY="your-gemini-api-key"
GCP_PROJECT_ID="your-gcp-project-id"
GCP_LOCATION="europe-west1"
RAG_GCS_BUCKET="your-rag-bucket"

GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"

TELNYX_API_KEY="your-telnyx-api-key"
TELNYX_PUBLIC_KEY_BASE64="your-telnyx-public-key"
TELNYX_CONNECTION_ID="your-telnyx-connection-id"

UPSTASH_REDIS_REST_URL="your-upstash-url"
UPSTASH_REDIS_REST_TOKEN="your-upstash-token"

STRIPE_SECRET_KEY="your-stripe-secret"
STRIPE_WEBHOOK_SECRET="your-stripe-webhook-secret"

WS_SERVICE_URL="wss://your-websocket-service"

Available scripts

pnpm dev                 # Start local development server
pnpm build               # Generate Prisma client and build the app
pnpm start               # Start production server
pnpm lint                # Run ESLint
pnpm typecheck           # Run TypeScript checks
pnpm test                # Run Vitest
pnpm test:run            # Run tests once
pnpm test:ui             # Run UI test project
pnpm test:evals          # Run AI evaluation suite
pnpm test:coverage       # Run tests with coverage
pnpm prisma generate     # Generate Prisma client
pnpm prisma migrate dev  # Apply local migrations
pnpm prisma studio       # Open Prisma Studio

Development

Start the local application:

pnpm dev

The app runs on http://localhost:3000 by default.

Production

Build the project:

pnpm build

Start the production server:

pnpm start

Testing

Agents boton.ONE uses Vitest for automated testing and includes dedicated evaluation suites for AI behavior, tools, and RAG quality.

pnpm test
pnpm test:run
pnpm test:ui
pnpm test:evals
pnpm test:coverage

Docker

docker-compose up --build -d

The repository also includes a production Dockerfile for containerized deployments.

Internationalization

Supported locales:

  • en
  • es

Deployment notes

The repository includes:

  • a production Dockerfile,
  • a docker-compose.yml stack,
  • Google Cloud Build configuration,
  • localized routing with next-intl,
  • API routes for chat, telephony, billing, RAG, tools, and integrations,
  • evaluation datasets and runtime observability setup.

Contributing

Contributions, issues, and ideas are welcome. For non-trivial changes, open an issue first to discuss the proposal before submitting a pull request.

License

This repository is licensed under the MIT License. See LICENSE.

Brand and assets

The source code is provided under the MIT License. Unless explicitly stated otherwise, the boton.ONE name, branding, domain references, and certain media or design assets may remain subject to separate rights and are not automatically granted for unrestricted commercial reuse.