Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sense Platform

Self-hosted developer platform for AI-powered video, voice, and vision apps

Build products that see, hear, and understand β€” with zero cloud lock-in


License: Apache 2.0 Docker Compose Python 3.11+ TypeScript PRs Welcome


Quick Start Β Β·Β  Demo Β Β·Β  Architecture Β Β·Β  SDKs Β Β·Β  Examples Β Β·Β  Docs



What is Sense Platform?

Sense Platform is a complete, self-hosted alternative to GetStream β€” rebuilt from scratch for AI-first products. Every component runs on your own servers with a single docker compose up.

What you replace

  • ❌ Stream Video (cloud WebRTC)
  • ❌ Stream Chat (cloud messaging)
  • ❌ Vendor AI add-ons
  • ❌ Per-seat / per-minute billing

What you get instead

  • βœ… Self-hosted WebRTC SFU (LiveKit engine)
  • βœ… Real-time WebSocket messaging
  • βœ… Native vision AI β€” MoodLens, PoseLens, GuardLens, FaceLens
  • βœ… Full ownership, no limits

πŸ§ͺ Demo

Run the interactive demo against your local stack β€” or in simulated mode without any services running:

# With the platform running
docker compose up -d
python demo.py

# Without the platform (simulated output)
python demo.py

What the demo walks through:

Step 1  Health-check all 5 services
Step 2  Authenticate with Sense Gate (API key β†’ JWT)
Step 3  Create a demo room
Step 4  Start an AI agent with MoodLens + FaceLens
Step 5  Send real-time messages via Sense Wire
Step 6  Stream live vision lens events
Step 7  Reconfigure MoodLens throttle at runtime
Step 8  Stop the agent and clean up

Sample output:

  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
  β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
  β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
  β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•

  AI-powered video Β· voice Β· vision β€” self-hosted

Step 1  Health-checking all services
  Sense Gate   :3000   [LIVE]       status=ok
  Sense Wire   :3001   [LIVE]       status=ok
  Sense Mind   :8080   [LIVE]       status=ok
  Sense Relay  :7880   [LIVE]       status=ok

Step 2  Authenticating with Sense Gate
  βœ“  Authenticated  [real JWT]

Step 4  Starting AI agent  (MoodLens + FaceLens)
  βœ“  Agent started  [live]
     room   = acme__demo-room
     llm    = claude-sonnet-4-6
     lenses = ['MoodLens', 'FaceLens']

Step 6  Streaming vision lens events
  [14:03:01] MOOD: NEUTRAL    conf=91%
             context β†’ Participant appears calm and attentive.

  [14:03:01] FACE: 1 detected conf=98%
             context β†’ 1 face detected in frame.

  [14:03:02] MOOD: CURIOUS    conf=83%
             context β†’ Participant is engaged and leaning forward.

  [14:03:03] MOOD: SATISFIED  conf=87%
             context β†’ Participant appears satisfied with the response.

πŸ— Architecture

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  Browser / SDK ────►│           Sense Gate  :3000           │◄──── Sense Console :4000
  Client        ◄────│      REST Β· Auth Β· Multi-tenancy      β”‚      Developer Dashboard
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚              β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              └────────────────────┐
              β”‚                                                         β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚    Sense Mind :8080  β”‚                              β”‚    Sense Wire  :3001     β”‚
   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  ── LensEventBridge ────────►│  WebSocket Messaging     β”‚
   β”‚  β”‚  AI Agents     β”‚  β”‚                              β”‚  Redis pub/sub fan-out   β”‚
   β”‚  β”‚  + AgentPool   β”‚  β”‚                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
   β”‚  β”‚ MoodLens       β”‚  β”‚
   β”‚  β”‚ PoseLens       β”‚  β”‚
   β”‚  β”‚ GuardLens      β”‚  β”‚
   β”‚  β”‚ FaceLens       β”‚  β”‚
   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  Sense Relay  :7880  β”‚         β”‚  Postgres  +  Redis       β”‚
   β”‚  WebRTC SFU           β”‚         β”‚  data Β· state Β· pub/sub   β”‚
   β”‚  (LiveKit engine)     β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Services at a glance
Service Role Port
Sense Relay Self-hosted WebRTC SFU β€” audio/video routing, no cloud 7880
Sense Mind AI agent engine β€” LLM Β· STT Β· TTS Β· Vision Lenses Β· AgentPool 8080
Sense Gate REST API gateway β€” JWT auth, multi-tenancy, webhooks, usage metering 3000
Sense Wire Real-time WebSocket messaging β€” Redis pub/sub cross-instance fan-out 3001
Sense Console Next.js developer dashboard β€” rooms, agents, keys, webhooks, usage 4000
Vision Lenses

Lenses are throttled vision processors that inject context directly into the agent's LLM prompt mid-conversation β€” no prompt engineering required.

Lens What it detects Throttle
MoodLens Emotion β€” frustrated Β· confused Β· satisfied Β· happy 3 s
PoseLens Body keypoints β€” posture, form faults, gestures 2 s
GuardLens Safety β€” weapons, explicit content, fire/smoke, tailgating 2 s
FaceLens Presence β€” face count, occupancy, identity continuity 5 s

πŸš€ Quick Start

Prerequisites: Docker Desktop Β· one LLM API key (Anthropic recommended)

1 Β· Clone and configure

git clone https://github.com/VenkataAnilKumar/SensePlatform
cd SensePlatform
cp .env.example .env

Add your key to .env:

ANTHROPIC_API_KEY=sk-ant-...

2 Β· Start the platform

docker compose up

All five services start automatically. First run pulls images (~2 min). After ~30 s:

URL Service
http://localhost:4000 Sense Console β€” developer dashboard
http://localhost:3000 Sense Gate β€” REST API
ws://localhost:3001 Sense Wire β€” WebSocket
http://localhost:8080 Sense Mind β€” agent control
ws://localhost:7880 Sense Relay β€” WebRTC

3 Β· Run the demo

python demo.py

4 Β· Start your first AI agent

curl -s -X POST http://localhost:3000/agents/start \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "room_id": "demo",
    "lenses": ["MoodLens"],
    "llm":    "claude-sonnet-4-6",
    "instructions": "You are a helpful assistant. Adapt to the user emotional state."
  }' | jq .

πŸ›  SDKs

Python SDK

pip install sense-platform
import asyncio
from sense import SenseClient, SenseWire, LensStream

async def main():
    async with SenseClient(api_key="sk_live_...") as client:
        await client.connect()

        # Launch AI agent with emotion detection
        await client.agents.start("demo", lenses=["MoodLens"])

        # Subscribe to messages + live lens events
        async with SenseWire(client, "messaging", "demo") as wire:
            stream = LensStream(wire)

            @stream.on_mood
            def on_mood(event):
                print(f"[{event.mood}] {event.context_text}")

            wire.on_message(lambda msg: print(f"{msg.user_id}: {msg.text}"))
            await wire.send("Hello from Python!")
            await wire.wait()

asyncio.run(main())

TypeScript / JavaScript SDK

npm install @sense/core @sense/vision @sense/chat @sense/lens
import { SenseClient } from "@sense/core";
import { SenseRoom }   from "@sense/vision";
import { Channel }     from "@sense/chat";
import { LensStream }  from "@sense/lens";

const client = new SenseClient({ apiKey: "sk_live_..." });
await client.connect();

// Join WebRTC room (publishes webcam + mic)
const room = new SenseRoom(client);
await room.join({ roomId: "demo", autoPublish: true });

// Chat
const channel = new Channel(client.wire, "messaging", "demo");
await channel.sendMessage("Hello from the browser!");

// Live vision events
const lenses = new LensStream(client.wire, "demo");
lenses.onMood((e) => console.log(`${e.mood} β€” ${e.contextText}`));
lenses.onGuard((e) => { if (e.violation) alert(`⚠ ${e.violationType}`); });
Sense Mind Agent SDK β€” build custom agents
from sense_mind import SenseMind, SenseRunner
from sense_mind.plugins import anthropic, deepgram, elevenlabs
from sense_mind.lenses import MoodLens, PoseLens

agent = SenseMind(
    instructions="""
        You are a supportive contact center agent.
        When the customer is frustrated, acknowledge it first.
        When confused, slow down and use plain language.
    """,
    llm=anthropic.LLM("claude-sonnet-4-6"),
    stt=deepgram.STT(),
    tts=elevenlabs.TTS(),
    lenses=[MoodLens(throttle_seconds=3), PoseLens()],
)

SenseRunner(agent, room="support-room-1").serve()

Supported plugins

Category Options
LLM anthropic Β· openai Β· gemini Β· mistral Β· openrouter Β· xai
STT deepgram Β· assemblyai Β· fast_whisper
TTS elevenlabs Β· cartesia Β· kokoro Β· fish Β· pocket
Vision ultralytics (YOLO) Β· moondream Β· roboflow Β· nvidia

⚑ Multi-Agent API

Sense Mind manages multiple agents concurrently β€” one per room, controlled via REST:

# Launch an agent
curl -X POST http://localhost:8080/agents/start \
  -H "Content-Type: application/json" \
  -d '{"room": "acme__room-1", "lenses": ["MoodLens"], "llm": "claude-sonnet-4-6"}'

# Check all running agents
curl http://localhost:8080/agents/status

# Tune lens throttle at runtime β€” zero downtime
curl -X POST http://localhost:8080/agents/acme__room-1/lenses/mood_lens/configure \
  -d '{"throttle_seconds": 5.0, "enabled": true}'

# Stop an agent
curl -X POST http://localhost:8080/agents/stop \
  -d '{"room": "acme__room-1"}'

πŸ“¦ Examples

Five production-grade examples in examples/:

Example Lenses What it does
contact-center/ MoodLens Β· FaceLens Adapts tone to frustration; escalates to human on trigger
sales-coach/ MoodLens Β· PoseLens Silent whisper coach β€” spots buying signals, flags objections
fitness-coach/ PoseLens Β· FaceLens Real-time form cues; rep counting; rest detection
telehealth/ FaceLens Β· PoseLens Β· MoodLens Clinical assistant β€” logs observations, flags distress
security-soc/ FaceLens Β· GuardLens Zone monitoring; weapon/threat detection; auto-incident

Run any example:

# Contact center
ANTHROPIC_API_KEY=sk-ant-... SENSE_ROOM=support python examples/contact-center/agent.py

# Fitness coach (squats)
EXERCISE=squat SENSE_ROOM=gym-alice python examples/fitness-coach/agent.py

# Security SOC β€” restricted zone
ZONE_TYPE=restricted ZONE_ID=server-room-a python examples/security-soc/agent.py

πŸ“– Documentation

Quick Start Up and running in 5 minutes
Architecture How the five services connect, data flow, multi-tenancy
Self-Hosting Guide TLS, backups, horizontal scaling, production checklist
Python SDK Reference Full API reference for every class and method
Contact Center Tutorial End-to-end product guide with React frontend + Python supervisor

βœ… Project Status

All eight phases shipped.

Phase What shipped
βœ… 1 β€” Core Sense Relay Β· Sense Mind Β· Vision Lenses Β· Docker Compose
βœ… 2 β€” Gate FastAPI gateway Β· JWT auth Β· multi-tenancy Β· webhooks Β· usage metering
βœ… 3 β€” Wire WebSocket messaging Β· Postgres persistence Β· Redis pub/sub fan-out
βœ… 4 β€” JS SDK @sense/core Β· @sense/vision Β· @sense/chat Β· @sense/lens
βœ… 5 β€” Console Next.js developer dashboard β€” rooms, agents, keys, webhooks, usage
βœ… 6 β€” Agent Pool Multi-agent pool Β· LensEventBridge Β· Vision Event Stream Β· /agents API
βœ… 7 β€” Py SDK + Docs sense-platform Python SDK Β· quickstart Β· architecture Β· self-hosting guide
βœ… 8 β€” Examples Contact center Β· sales coach Β· fitness coach Β· telehealth Β· security SOC

Apache 2.0 Β· Built with LiveKit, FastAPI, Next.js, and Claude

About

Build AI-powered video, voice, and chat applications with real-time intelligence in hours. Self-hosted. No cloud dependencies.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages