{"id":19947359,"url":"https://github.com/firstbatchxyz/firstbatch-sdk","last_synced_at":"2025-07-12T15:40:40.789Z","repository":{"id":198725630,"uuid":"701356291","full_name":"firstbatchxyz/firstbatch-sdk","owner":"firstbatchxyz","description":"Python SDK for FirstBatch: Real-time personalization using vectorDBs","archived":false,"fork":false,"pushed_at":"2023-11-26T18:34:05.000Z","size":227,"stargazers_count":15,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T00:35:38.634Z","etag":null,"topics":["chromadb","personalization","pinecone","sdk-python","supabase","typesense","vector-database","vectordb","weaviate"],"latest_commit_sha":null,"homepage":"https://firstbatch.xyz","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstbatchxyz.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-06T13:20:28.000Z","updated_at":"2024-07-01T22:01:57.000Z","dependencies_parsed_at":"2023-10-23T11:37:01.202Z","dependency_job_id":null,"html_url":"https://github.com/firstbatchxyz/firstbatch-sdk","commit_stats":null,"previous_names":["firstbatchxyz/firstbatch-sdk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Ffirstbatch-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Ffirstbatch-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Ffirstbatch-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Ffirstbatch-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstbatchxyz","download_url":"https://codeload.github.com/firstbatchxyz/firstbatch-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233570243,"owners_count":18695849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chromadb","personalization","pinecone","sdk-python","supabase","typesense","vector-database","vectordb","weaviate"],"created_at":"2024-11-13T00:35:45.925Z","updated_at":"2025-01-12T05:27:35.375Z","avatar_url":"https://github.com/firstbatchxyz.png","language":"Python","readme":"# FirstBatch SDK\n\nThe FirstBatch SDK provides an interface for integrating vector databases and powering personalized AI experiences in your application.\n\n## Key Features\n\n- Seamlessly manage user sessions with persistent IDs or temporary sessions\n- Send signal actions like likes, clicks, etc. to update user embeddings in real-time\n- Fetch personalized batches of data tailored to each user's embeddings  \n- Support for multiple vector database integrations: Pinecone, Weaviate, etc.\n- Built-in algorithms for common personalization use cases\n- Easy configuration with Python classes and environment variables\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3.9+\n- API keys for FirstBatch and your chosen vector database\n\n### Installation\n\n```\npip install firstbatch\n```\n\n## Basic Usage\n\n1. **Initialize VectorDB of your choice**\n    ```python\n   api_key = os.environ[\"PINECONE_API_KEY\"]\n   env = os.environ[\"PINECONE_ENV\"]\n\n   pinecone.init(api_key=api_key, environment=env)\n   index = pinecone.Index(\"your_index_name\")\n   \n   # Init FirstBatch\n   config = Config(batch_size=20)\n   personalized = FirstBatch(api_key=os.environ[\"FIRSTBATCH_API_KEY\"], config=config)\n   \n   personalized.add_vdb(\"my_db\", Pinecone(index, embedding_size=1536))\n    ```\n\n### Personalization\n\n2. **Create a session with an Algorithm suiting your needs**\n    ```python \n   session = personalized.session(algorithm=AlgorithmLabel.AI_AGENTS, vdbid=\"my_db\")\n    ```\n\n3. **Make recommendations**\n    ```python\n   ids, batch = personalized.batch(session)\n    ```\n4. **Let users add signals to shape their embeddings**\n   ```python\n   user_pick = 0  # User liked the first content from the previous batch.\n   personalized.add_signal(session, UserAction(Signal.LIKE), ids[user_pick])\n   ```\n\n## Support\n\nFor any issues or queries contact `support@firstbatch.xyz`.\n\n  \n## Resources\n\n- [User Embedding Guide](https://firstbatch.gitbook.io/user-embeddings/)\n- [SDK Documentation](https://firstbatch.gitbook.io/firstbatch-sdk/)\n\nFeel free to dive into the technicalities and leverage FirstBatch SDK for highly personalized user experiences.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Ffirstbatch-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstbatchxyz%2Ffirstbatch-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Ffirstbatch-sdk/lists"}