Skip to main content

FirstBatch SDK

The FirstBatch SDK provides an interface for integrating vector databases and powering personalized AI experiences in your application.

Key Features

  • Seamlessly manage user sessions with persistent IDs or temporary sessions
  • Send signal actions like likes, clicks, etc. to update user embeddings in real-time
  • Fetch personalized batches of data tailored to each user's embeddings
  • Support for multiple vector database integrations: Pinecone, Weaviate, etc.
  • Built-in algorithms for common personalization use cases
  • Easy configuration with Python classes and environment variables

Getting Started

Prerequisites

  • Python 3.9+
  • API keys for FirstBatch and your chosen vector database

Installation

pip install firstbatch

Basic Usage

  1. Initialize VectorDB of your choice
    api_key = os.environ["PINECONE_API_KEY"]
    env = os.environ["PINECONE_ENV"]
    
    pinecone.init(api_key=api_key, environment=env)
    index = pinecone.Index("your_index_name")
    
    # Init FirstBatch
    config = Config(batch_size=20)
    personalized = FirstBatch(api_key=os.environ["FIRSTBATCH_API_KEY"], config=config)
    
    personalized.add_vdb("my_db", Pinecone(index, embedding_size=1536))
    

Personalization

  1. Create a session with an Algorithm suiting your needs

    session = personalized.session(algorithm=AlgorithmLabel.AI_AGENTS, vdbid="my_db")
    
  2. Make recommendations

    ids, batch = personalized.batch(session)
    
  3. Let users add signals to shape their embeddings

    user_pick = 0  # User liked the first content from the previous batch.
    personalized.add_signal(session, UserAction(Signal.LIKE), ids[user_pick])
    

Support

For any issues or queries contact support@firstbatch.xyz.

Resources

Feel free to dive into the technicalities and leverage FirstBatch SDK for highly personalized user experiences.

Metadata

Release files for firstbatch 0.1.73

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for firstbatch 0.1.73
File Size Uploaded Provenance
firstbatch-0.1.73.tar.gz 93.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for firstbatch 0.1.73
File Interpreter ABI Platform
firstbatch-0.1.73-py3-none-any.whl Python 3 none any Details

Total release size: 144.6 kB

Release files / firstbatch-0.1.73.tar.gz

Download URL firstbatch-0.1.73.tar.gz
Size 93.9 kB
Tags Source
SHA-256 checksum
How to use checksums
806d6dbe82960965cf7faa59265cd1dedad199e02d03f62539af5aacb9fe527c
BLAKE2b-256 checksum
How to use checksums
5f2b93c32aace30a0e817a7a9de79c31b9009f119cc2c5399e2ac62672dd6564
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.9.12 Darwin/21.6.0

Release files / firstbatch-0.1.73-py3-none-any.whl

Download URL firstbatch-0.1.73-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42d8e88dcdcfa5fddc03275c3eb97fbd55478ced67ce3538be5f9247c80b90aa
BLAKE2b-256 checksum
How to use checksums
ef27d0d58f7b0caa33d9441b16ddf69de3405ddc266b00facf04cde3d12ab5b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.9.12 Darwin/21.6.0

Security for firstbatch 0.1.73

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.73 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page