Skip to content

Litebase Stream

High-performance real-time event streaming for AI and data-driven applications.

Overview

Litebase Stream is a developer-first event streaming platform designed for real-time AI inference, event-driven workflows, and large-scale data pipelines.

  • ✅ Fast event publishing & retrieval for AI-driven applications.
  • ✅ Real-time AI insights for chatbots, recommendation systems, and analytics.
  • ✅ Low-latency ingestion for AI/ML pipelines and high-throughput streaming workloads.
  • ✅ Replayable event logs for debugging, monitoring, and reproducibility.

Use Cases

1️⃣ Real-Time AI Processing

  • Stream AI model inferences for chatbots, speech recognition, and autonomous systems.
  • Process live sensor data for AI-driven decision-making.
  • Build event-driven multi-agent AI workflows.

2️⃣ AI Model Inference & Monitoring

  • Log model outputs & predictions for monitoring and debugging.
  • Stream real-time model updates for adaptive AI applications.
  • Store structured AI-generated events for observability and tracking.

3️⃣ Event-Driven AI Pipelines

  • Automate AI-powered workflows with real-time triggers.
  • Stream AI-driven recommendations and personalization.
  • Integrate with data lakes, vector databases, and AI-based search.

Usage

1️⃣ Install the SDK

Litebase Stream supports Deno, Node.js.

sh
# Deno
deno add jsr:@litebaseio/stream

# Node.js
npx jsr add @litebaseio/stream

2️⃣ Publish Events to an AI Workflow

Use Litebase Stream to commit AI inference results, model updates, and structured events.

typescript
import {open} from "@litebaseio/stream";

const stream = open("stream://ai-events");

const tx = await stream.commit({
    model: "gpt-4",
    query: "What is quantum computing?",
    response: "Quantum computing harnesses...",
    timestamp: new Date().toISOString(),
});

console.log(`Event committed with ID: ${tx}`);
sh
curl -X POST "https://api.litebase.io/stream/ai-events/commit" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4",
    "query": "What is quantum computing?",
    "response": "Quantum computing harnesses...",
    "timestamp": "2025-02-20T10:00:00Z"
  }'

3️⃣ Retrieve AI-Generated Events

Fetch stored AI events for monitoring, analysis, or debugging.

typescript
const event = await stream.get(1250);
console.log("Retrieved AI-generated event:", event.data);
sh
curl -X GET "https://api.litebase.io/stream/ai-events/event/1250" \
  -H "Authorization: Bearer YOUR_API_KEY"

4️⃣ Stream Real-Time AI Events

Subscribe to live AI-generated events in real time.

typescript
for await (const event of stream.subscribe(2000)) {
    console.log("New AI-generated event:", event);
}
sh
# WebSockets or SSE required for real-time streaming. Use an appropriate WebSocket client.

5️⃣ Replay Historical AI Inferences

Retrieve past AI-generated events for reproducibility and debugging.

typescript
const events = await stream.list({startTx: 1000, limit: 10});
console.log("AI inference history:", events);
sh
curl -X GET "https://api.litebase.io/stream/ai-events/list?startTx=1000&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

FAQ

Can Litebase Stream handle high-throughput AI events?

Yes, Litebase Stream is optimized for low-latency, high-frequency event streaming, making it ideal for AI-driven workflows.

How does Litebase Stream support AI debugging?

Litebase Stream stores immutable event logs, allowing engineers to replay past AI model outputs and analyze system behavior.

Can I subscribe to real-time AI-generated events?

Yes! Litebase Stream supports live event subscriptions, making it easy to power real-time AI applications and event-driven workflows.