FirstBatch SDK for integrating user embeddings to your project. Add real-time personalization to your AI application without user data.
Project description
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
- 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
-
Create a session with an Algorithm suiting your needs
session = personalized.session(algorithm=AlgorithmLabel.AI_AGENTS, vdbid="my_db")
-
Make recommendations
ids, batch = personalized.batch(session)
-
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file firstbatch-0.1.73.tar.gz
.
File metadata
- Download URL: firstbatch-0.1.73.tar.gz
- Upload date:
- Size: 93.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.12 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 806d6dbe82960965cf7faa59265cd1dedad199e02d03f62539af5aacb9fe527c |
|
MD5 | 45aa2f9e059ffc47626cc4d7ba8301f2 |
|
BLAKE2b-256 | 5f2b93c32aace30a0e817a7a9de79c31b9009f119cc2c5399e2ac62672dd6564 |
File details
Details for the file firstbatch-0.1.73-py3-none-any.whl
.
File metadata
- Download URL: firstbatch-0.1.73-py3-none-any.whl
- Upload date:
- Size: 50.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.12 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42d8e88dcdcfa5fddc03275c3eb97fbd55478ced67ce3538be5f9247c80b90aa |
|
MD5 | fc5988d93ff613fd5c70dbcbb60b82a3 |
|
BLAKE2b-256 | ef27d0d58f7b0caa33d9441b16ddf69de3405ddc266b00facf04cde3d12ab5b2 |