JS
Back to all projects

OpenAssistant-AI

An open-source serverless Telegram assistant built with TypeScript and Supabase Edge Functions. Features multi-provider LLM routing, structured tool execution, and scheduled morning intelligence digests.

TypeScriptSupabaseLLMsServerless
Architecture01

Serverless Edge Functions (Deno)

01
Database02

Supabase PostgreSQL

02
AI Routing03

Gemini 2.5/3.5 · Claude · OpenAI

03
Infrastructure Cost04

$0 Idle Running Cost

04

HOW IT WAS ACTUALLY BUILT.

[01] The objectiveStep 1 of 5
OpenAssistant-AI
[01] · The objective

An AI assistant on the messaging client I already use

Existing AI assistants require dedicated apps, expensive subscriptions, and always-on servers. I wanted a zero-maintenance, private assistant living inside Telegram that wakes up instantly and incurs zero costs when idle.

[02] · Serverless edge

Sub-second webhook execution on Deno

Engineered a TypeScript runtime deployed to Supabase Edge Functions. Incoming Telegram webhook updates are verified with cryptographic headers and dispatched in under 50ms with no server provisioning.

[03] · Multi-provider routing

Balancing speed, token economy, and reasoning

Created a dynamic provider router that automatically dispatches fast lookups to Gemini Flash, deep code analysis to Claude 3.5 Sonnet, and utility tasks to OpenAI with automated graceful failover.

[04] · Scheduled intelligence

Automated 8:00 AM daily briefing briefings

Utilized pg_cron and edge invocations to autonomously summarize RSS feeds, priority reminders, and market news into a clean morning intelligence brief delivered directly to chat every morning.

[05] · Structured tools

Deterministic actions from natural language

Implemented strict JSON schema tool validation for reminders, web searches, note storage, and calculator operations, turning conversational instructions into verified database transactions.

THE NUMBERS BEHIND THE BUILD.

METRIC #01VERIFIED
012345678901234567890123456789 ms

Cold start time

01
METRIC #02VERIFIED
0123456789 $

Monthly hosting cost

02
METRIC #03VERIFIED
01234567890123456789.0123456789 %

Provider uptime

03

DEEP DIVE INTO THE STACK.

Architecture specifics across firmware, hardware design, and models.

Stateless TypeScript handlers handling webhook ingestion, streaming chunk synthesis, and markdown formatting for Telegram Bot API.

Custom API client supporting token counting, retry backoff with jitter, conversation sliding windows, and prompt caching.

Supabase PostgreSQL instance storing user session contexts, scheduled jobs, and encrypted configuration with strict row-level security.