FirstBatch SDK
  • Get Started
    • Introduction
    • Installation
    • Quick Start
  • Learn
    • Key Concepts
      • Embeddings
      • Vector Databases
      • User Embeddings
    • Sessions
    • Signals
    • Batches
    • Algorithms
      • Batch Types
        • Random
        • Sampled
        • Personalized
        • Biased
      • Parameters & Tuning
    • Cookbook
      • Simple Flask App
      • Personalized RSS Feed
      • Personalized Mini TikTok
      • User-Intent AI Agents
      • Extending RAG: User Embeddings
      • Prompt Based User Journeys
      • User-Centric Promoted Content
  • Modules
    • FirstBatch
    • Algorithms
    • VectorStores
      • Pinecone
      • Weaviate
      • Qdrant
      • Typesense
      • Supabase
      • Chroma
Powered by GitBook
On this page
  • Stateless
  • Attributes
  1. Learn

Sessions

Sessions are the key operation of FirstBatch. Each visitor to your app creates a session through FirstBatch SDK.

Sessions are required for FirstBatch to operate.

There are two types of sessions

  • Temporary: Session is destroyed within 1 hour, Id created randomly by FirstBatch

session = personalized.session(
                algorithm=AlgorithmLabel.SIMPLE, 
                vdbid="my_db"
                )
  • Persistent: Session is persistent, id is given by the user

session = personalized.session(
                session_id="newid",
                algorithm=AlgorithmLabel.SIMPLE, 
                vdbid="my_db"
                )

Stateless

FirstBatch manages sessions for you. An algorithm has multiple states and each session can be at a different state of the same algorithm or even a different algorithm. This design is to make it easy to integrate a stateless backend with FirstBatch and reduce development complexity.

Attributes

A session consists of:

  • ID -> session ID

  • Algorithm -> Type AlgorithmLabel

  • State -> State of the algorithm

  • User Embeddings -> List of vectors and their corresponding weights

Each type of Signal and Batch action updates the session state with the FirstBatch SDK.

PreviousUser EmbeddingsNextSignals

Last updated 1 year ago