Realtime Agent Backend — Data skill for Claude Code
Production-style backend for real-time AI chat agents: FastAPI, WebSocket token streaming, Redis + PostgreSQL memory, per-conversation locking, tool calling, pgvector RAG, Claude & OpenAI adapters.
How to install Realtime Agent Backend
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open tavlant/realtime-agent-backend and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Realtime Agent Backend does
Production-style backend for real-time AI chat agents: FastAPI, WebSocket token streaming, Redis + PostgreSQL memory, per-conversation locking, tool calling, pgvector RAG, Claude & OpenAI adapters. Runs offline with a fake LLM.
Alternatives in Data
- Private GPT — Complete API layer for private AI applications on local models: RAG, skills, tools, MCP, text-to-sql, and more 57.5k ★
- LLM Redteam — LLM red-team corpus runner — fires categorized prompt-injection / jailbreak / system-prompt-leak / data-exfil 4.5k ★
- Azure Event Hub .net — High-throughput event streaming 1.8k ★
README
realtime-agent-backend
[](https://github.com/tavlant/realtime-agent-backend/actions/workflows/ci.yml)  
A production-style **FastAPI backend for LLM chat agents**: assistant replies stream token by token over WebSockets, the agent can call tools, conversations have durable memory, and a small RAG pipeline answers questions from your own documents.
It is built the way I'd build this for real traffic: async end to end, safe under concurrency, resilient to slow or flaky model providers, observable, and **fully runnable offline**. No API key is needed to run it, test it or load-test it.
**Highlights**
- Streaming over WebSockets.
/ws/conversations/{id}streams tokens, tool calls and tool results as typed JSON events. - Two-tier memory. Recent context lives in Redis (with a TTL); Postgres keeps the full history and is the source of truth. Older turns are folded into a rolling summary once the context goes over a token budget.
- No interleaved turns. A per-conversation distributed Redis lock (random owner token, TTL plus watchdog renewal) keeps turns in order across tabs and replicas.
- Tool calling. A typed tool registry (Pydantic-validated arguments, timeouts, error isolation) with a safe AST calculator, a clock and knowledge-base search. The agent loop runs tool calls concurrently and feeds the results back to the model.
- Mini RAG. Ingest Markdown or text, then chunk (heading-aware), embed, store in pgvector (HNSW index) and search semantically. An in-memory store is used for dev and tests.
- Provider abstraction. Anthropic and OpenAI adapters (streaming plus tool calls) sit behind one interface, plus a deterministic FakeLLM for tests and offline use.
- Reliability. First-token and idle timeouts, retries
Related Skills
Clinic AI Receptionist
WhatsApp AI receptionist for clinics — FastAPI + Postgres/pgvector + Claude. Answers FAQs via RAG, books appoi
Premarket AI
AI pre-market news platform that separates real market news from fake. It migrates a legacy C++11/PostgreSQL/P
Redis Search
Scaffold Redis search adapters (RediSearch full-text, vector, search caching)
Xiaoman
Xiaoman (小满) — a conversation-first, local-first personal finance AI agent · FastAPI + LangGraph + React · dat
Docwise Agentic
Full agentic RAG pipeline: adaptive chunking → Qdrant hybrid search (semantic + BM25 + RRF) → LangGraph ReAct
OpenCoding
Enterprise-grade multi-modal Coding Agent Harness — kernel, tools, permissions, sandbox, memory, teams, goals,
Related Agents
Realtime API Engineer
Use proactively for all OpenAI Realtime API integration - WebRTC setup, audio streaming, session management, a
Vercel AI SDK Expert
Use for Vercel AI SDK v5 implementation work: chat interfaces, tool calling, streaming, agentic loop control,
LLM Integrator
LLM integration specialist who connects to OpenAI/Anthropic/Ollama APIs, designs prompt templates, implements