Pixeltable Documentation

repository·main·Indexed 23 days ago

https://github.com/pixeltable/pixeltable

Pixeltable is a unified multimodal backend for AI data applications, providing a declarative, multimodal, and incremental AI data infrastructure. It simplifies storing media, running models, and managing embeddings via a single Python API. The platform supports a wide range of workflows including Vision AI, audio/video processing (Whisper, Veo), RAG pipelines, and semantic search using CLIP embeddings. It features a query-based architecture for on-demand processing and caching of expensive AI operations.

Tokens
80.5K
Snippets
179
Records
336
Agent score
80%

What's inside pixeltable

  1. Overview of Pixeltable

    main

    Pixeltable is a unified multimodal backend designed for building AI data applications. It replaces the need to manually glue together separate components like blob storage, vector databases, orchestrators, and edge functions.

    Key features include:

    • Unified API: A single Python API to store media, run models, index embeddings, and serve endpoints.
    • Automated Pipelines: Chunking, embeddings, and agents run automatically via computed columns upon data insertion.
    • Built-in Reliability: Includes native support for transactions, caching, retries, and observability.
    • Extensibility: Developers can extend the system using @pxt.udf (User Defined Functions), @pxt.uda (User Defined Aggregations), and @pxt.query.
  2. Overview of Prompt Engineering Studio features

    main

    The Prompt Engineering Studio is a sample application designed to demonstrate how Pixeltable can be used for LLM testing and prompt engineering. It provides the following capabilities:

    • Model Comparison: Side-by-side comparison of responses from different LLM models.
    • Parameter Tuning: Interactive control over model parameters like temperature and top_p.
    • Experiment Tracking: Automatic versioning and history of all prompts and their corresponding results.
    • Advanced Analytics: Automatic analysis of model outputs using computed columns for metrics like sentiment analysis, readability scoring, and keyword extraction.
    • Historical Analysis: Ability to query and review past experiments and analytics.
  3. What is Pixeltable?

    main

    Pixeltable is a declarative data infrastructure for multimodal AI applications. It allows you to define data processing and AI workflows using computed columns on tables.

    Key capabilities include:

    • Data Ingestion & Storage: Handles structured data and references multimodal files (images, videos, audio, docs) in place.
    • Transformation & Processing: Automatically applies Python User-Defined Functions (UDFs) or built-in operations like chunking and frame extraction.
    • AI Model Integration: Integrates inference (embeddings, object detection, LLMs) directly into the data pipeline.
    • Indexing & Retrieval: Manages vector indexes for semantic search alongside traditional filtering.
    • Incremental Computation: Only recomputes what is necessary when data or code changes.
    • Versioning & Lineage: Automatically tracks schema and data changes for reproducibility.
  4. Understand Pixeltable core concepts

    main

    Pixeltable is designed for managing multimodal data and machine learning workflows. Its core capabilities are organized into three primary conceptual pillars:

    1. Tables and Data Operations: Creating and managing multimodal data tables, importing datasets, and performing essential operations like filtering, selecting, and ordering data.
    2. Computed Columns: Automating data transformations and integrating ML models using columns that compute values dynamically. These support automatic versioning and lineage tracking.
    3. Queries & Expressions: Using an expressive query system to perform complex data operations, ranging from simple filters to advanced transformations across images, video, text, and embeddings.
  5. Available Pixeltable Demo Categories

    main

    Pixeltable's capabilities are demonstrated through several functional categories:

    Content Generation & Analysis

    • Video to Social Media Post Generator: Transforms videos into social media content using AI analysis.
    • AI Video Analyzer with OpenAI: Generates video narratives with multi-style analysis and TTS (Text-to-Speech) narration.
    • Collaborative Story Builder: AI-assisted story creation with version control.

    RAG & Question Answering

    • Multi-LLM RAG Comparison: Compares different LLMs for RAG tasks using ground truth evaluation.
    • AI Chatbot with RAG: Intelligent chatbots using document context and semantic search.
    • Document to Audio Synthesis: Converts documents to natural-sounding audio.

    Computer Vision Applications

    • Text-Image Similarity Search: Searches video frames using text or image queries via CLIP embeddings.
    • Object Detection in Videos: Real-time object detection using YOLOX.
    • Call Analysis AI Tool: Analyzes call recordings via transcription and insight extraction.

    Specialized Applications

    • AI Financial Analysis: Market analysis using technical indicators.
    • AI RPG Adventure: Dynamic AI-generated narratives for interactive storytelling.
    • Prompt Engineering Studio: Rapid iteration and testing of LLM prompts.

    Development Tools

    • Multimodal Powerhouse: A showcase of Pixeltable's unified interface for building multimodal applications.
  6. Explore Pixeltable application categories

    main

    Pixeltable provides several specialized application patterns that you can implement using its core capabilities. Use these categories to guide your development:

    Chat Applications

    • Multimodal Chat: Interfaces that process images, videos, and documents simultaneously.
    • Memory Systems: Systems for managing conversation history and context.
    • Tool Integration: Adding external capabilities like web search or API calls to chat workflows.

    Vision Applications

    • Voxel51 Workflow: Advanced dataset management and curation using Voxel51.
    • YOLOX Detection: Real-time object detection systems.

    Search Applications

    • Audio Search: Semantic search capabilities for audio content.
    • Image Search: Visual search with automatic indexing.
    • PDF & Web Search: Search systems for documents and websites.
  7. Available Pixeltable recipes by category

    main

    Pixeltable provides a wide range of recipes for multimodal AI workflows. Use these categories to find the specific implementation you need:

    Images & Vision AI

    • Image Processing: PIL operations (resize, rotate, etc.) and adding watermarks.
    • Vision AI: Batch analysis, extracting structured JSON from images, generating captions, and object detection (YOLOX) with visualization.

    Audio & Video

    • Audio: Transcription (Whisper), speaker diarization, podcast summarization, extracting audio from video, and text-to-speech (OpenAI TTS).
    • Video: Frame extraction, thumbnail generation, scene change detection, and adding text overlays.
    • Video Generation: Text-to-video and image-to-video using Veo.
    • Text: Summarization, translation, and named entity extraction.
    • Documents: Splitting PDFs into chunks for RAG (Retrieval-Augmented Generation).
    • Search & Embeddings: Semantic text search, visual similarity search (CLIP), and creating text embeddings (OpenAI).

    Data Management

    • Import: Load data from CSV, Excel, Parquet, JSON, Hugging Face datasets, or cloud storage (S3/GCS/HTTP).
    • Export & ML: Exporting to PyTorch DataLoaders and data sampling (random/stratified).
    • Queries: Joining tables, creating custom User-Defined Aggregates (UDAs), and custom iterators.

    Advanced Patterns & Workflow

    • AI Patterns: Building RAG pipelines, agents with semantic memory, and multi-agent workflows using tables as reusable functions (UDFs).
    • Workflow: Configuring API keys, extracting fields from JSON, version control/reverting changes, and generating UUIDs.
    • LLMs: Implementing tool calling/function calling.
  8. Multimodal Chat Application features and integrations

    main

    The Multimodal Chat Application demonstrates several key capabilities:

    • Multimodal Data Support: Ability to process and analyze documents, videos, and audio files.
    • Advanced Processing: Uses Pixeltable's specialized data types and formats.
    • Flexible LLM Integration:
      • Default: OpenAI
      • Alternatives: Ollama or LLama.cpp
    • Local Processing: Supports local transcription using Whisper or WhisperX.
  9. Overview of the AI Trading Analysis Data Flow

    main

    The system follows a five-phase lifecycle to transform a chart screenshot into actionable trading insights using Pixeltable and Claude Sonnet:

    1. Image Capture: The Chrome extension captures the chart and generates a requestId.
    2. Initial Processing: The extension sends the image via POST /analyze to the FastAPI backend, which initializes a Pixeltable analysis table.
    3. AI Analysis: Pixeltable processes the image through computed columns, sending it to Claude Sonnet for structured analysis.
    4. Data Processing & Storage: Pixeltable parses the AI response to extract technical indicators (MACD, RSI, etc.), support/resistance levels, and trade setups, then stores the results.
    5. Response Delivery: The backend queries Pixeltable by requestId to retrieve the processed analysis and sends the JSON response back to the extension UI.
  10. How CLIP Semantic Search works in Pixeltable

    main

    Semantic search is performed by calculating the similarity between a text query and visual embeddings (frames or images) stored in a CLIP index. You can use the .similarity() method on a column and order the results by that similarity score.

    Example of similarity search across video frames:

    # Similarity search across video frames
    results = frames_view.order_by(
        frames_view.frame.similarity(query, idx='frame_clip_idx'),
        asc=False
    ).limit(5).collect()
  11. Implement similarity search with Embedding Indexes

    main
    Pixeltable features a declarative indexing system for performing similarity searches across various data types. These embedding indexes are designed for automatic maintenance, meaning the index updates as your data changes, and they provide efficient lookups for vector search and semantic search applications.
  12. How the Intelligence Hub Data Pipeline Works

    main

    The Intelligence Hub demonstrates Pixeltable's core value proposition: the pipeline is the table. Unlike traditional orchestrators (n8n/Zapier) that require triggers or cron jobs, Pixeltable uses computed columns to execute a multi-step AI pipeline automatically upon a single insert() call.

    The Automated Workflow

    When you insert a row into the sources table, the following steps occur automatically:

    1. Ingestion: Fetches documents from URLs, CSVs, or Google Sheets.
    2. Chunking: Splits documents into sentences (using document_splitter).
    3. Embedding: Automatically creates an embedding index for semantic search.
    4. AI Processing: Generates summaries (via LLM) and relevance scores (via custom UDFs).
    5. Notification: Formats and sends alerts to configured channels (Slack, Discord, etc.) if scores meet thresholds.
    6. Export: Optionally archives data to formats like Parquet.

    This incremental approach ensures that every new piece of data is immediately processed, indexed, and potentially acted upon without manual orchestration.