ChatKit Backend - SSE and Conversation Persistence

Stream AI responses via SSE and persist conversations with FastAPI and SQLModel.

Updated Jan 3, 2026
One-click install
npx skills add https://github.com/nimranaz148/spec-driven-ToDo-App-2 --skill chatkit-backend-sse-and-conversation-persistence
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ChatKit Backend - SSE and Conversation Persistence
Source: https://github.com/nimranaz148/spec-driven-ToDo-App-2/tree/main/.claude/skills/chatkit-backend
Command: npx skills add https://github.com/nimranaz148/spec-driven-ToDo-App-2 --skill chatkit-backend-sse-and-conversation-persistence

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ChatKit Backend - SSE and Conversation Persistence provides backend infrastructure for streaming AI responses via Server-Sent Events and persistent conversations with messages using FastAPI and SQLModel.

Core Features & Use Cases

  • SSE streaming endpoint for real-time AI responses
  • Database models and migrations for conversations and messages
  • CRUD endpoints for conversations and messages
  • Conversation history and persistence with message tracking
  • Easy integration with frontend chatkit-frontend or similar UI

Quick Start

Install dependencies (Python 3.11+, FastAPI, SQLModel, Alembic) and set up a PostgreSQL instance, then run migrations and start the server with uvicorn. Access API docs at http://localhost:8000/docs. Use the SSE endpoint at http://localhost:8000/api/chat/stream?message=Hello

Frequently Asked Questions about ChatKit Backend - SSE and Conversation Persistence

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement SSE streaming for real-time AI chat responses in FastAPI?

SSE streaming for real-time AI chat responses in FastAPI is implemented by exposing a dedicated endpoint that streams OpenAI agent outputs directly to the client. This Skill provides that SSE streaming layer alongside persistent conversation history and message CRUD operations.

What is the best way to persist chat conversation history using SQLModel and PostgreSQL?

To persist chat conversation history using SQLModel and PostgreSQL, you need defined Conversation and Message database models paired with Alembic migrations. This Skill supplies those exact models and migrations to track and store chat interactions seamlessly.

Do I need Python 3.11 and PostgreSQL to run this FastAPI chat backend?

Yes, you need Python 3.11+ and PostgreSQL to run this FastAPI chat backend. The implementation relies on SQLModel for database interactions and Alembic for migrations, requiring a PostgreSQL instance to manage persistent conversations and messages effectively.

How do I set up database migrations for FastAPI chat messages with Alembic?

To set up database migrations for FastAPI chat messages with Alembic, configure your SQLModel Conversation and Message schemas, then run the Alembic migration commands to generate and apply the tables to your PostgreSQL database before starting the Uvicorn server.

Can I use this SSE backend with my existing frontend chat UI?

Yes, you can use this SSE backend with an existing frontend chat UI. It provides standard Server-Sent Events streaming through a specific endpoint and CRUD APIs, allowing easy integration with chatkit-frontend or similar chat interface components.