Metadata-Version: 2.2
Name: cyborgdb-lite
Version: 0.10.1.dev0
Summary: Evaluation Version of CyborgDB: The Confidential Vector Database
Author: Cyborg Inc.
License: Proprietary
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: C++
Classifier: Topic :: Database
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries
Project-URL: Homepage, https://www.cyborg.co
Project-URL: Documentation, https://docs.cyborg.co
Requires-Python: >=3.9
Requires-Dist: numpy>=1.24.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
Requires-Dist: sentence-transformers>=2.2.0; extra == "langchain"
Provides-Extra: embeddings
Requires-Dist: sentence-transformers>=2.2.0; extra == "embeddings"
Provides-Extra: all
Requires-Dist: langchain-core>=0.1.0; extra == "all"
Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
Description-Content-Type: text/markdown

# CyborgDB Lite

![PyPI - Version](https://img.shields.io/pypi/v/cyborgdb_lite)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cyborgdb_lite)

**CyborgDB Lite** is an evaluation-only/non-commercial preview of CyborgDB, the first Confidential Vector Database. It enables you to ingest & search vectors emeddings in a privacy-preserving manner, without revealing the contents of the vectors themselves. CyborgDB works with existing DBs (e.g., Postgres, Redis) and enables you to add, query and retrieve vector embeddings with transparent end-to-end encryption.

## Why Confidential?

Vector Search is at the heart of popular AI applications like RAG, recommendation systems, and semantic search. CyborgDB Lite leverages cryptographic hashing and symmetric encryption to enable Approximate Nearest-Neighbor (ANN) search over encrypted space, keeping your vector embeddings secure throughout their lifecycle.

## Key Features

- **End-to-End Encryption**: Vector embeddings remain encrypted throughout their lifecycle, including at search time
- **Zero-Trust Design**: Novel architecture keeps confidential inference data secure
- **High Performance**: GPU-accelerated indexing and retrieval with CUDA support
- **Familiar API**: Easy integration with existing AI workflows
- **Multiple Backing Stores**: Works with PostgreSQL, Redis, and in-memory storage
- **Cloud Ready**: Supports AWS RDS, AWS ElastiCache, Azure Database for PostgreSQL, Azure Cache for Redis, Google Cloud SQL, and Google Cloud Memorystore

## Installation

```bash
# Ensure Python 3.9 - 3.13 is installed
# You may want to create a virtual environment:
conda create -n cyborg-env python=3.12
conda activate cyborg-env

# Install CyborgDB Lite:
pip install cyborgdb-lite
```

## Quickstart

```python
import cyborgdb_lite as cyborgdb
import secrets

# Create a client with memory storage
# You can replace this with Postgres
index_location = cyborgdb.DBConfig("memory")  # For index contents
config_location = cyborgdb.DBConfig("memory") # For config/loading
items_location = cyborgdb.DBConfig("memory")  # For item contents

# Create a client
client = cyborgdb.Client(index_location, config_location, items_location)

# Create an IVFFlat index
index_config = cyborgdb.IndexIVFFlat(dimension=4, n_lists=1024)

# Generate an encryption key for the index
index_key = secrets.token_bytes(32)

# Create an encrypted index
index = client.create_index("my_index", index_key, index_config)

# Add items to the encrypted index
items = [
    {"id": "item_1", "vector": [0.1, 0.2, 0.3, 0.4], "contents": "Hello!"},
    {"id": "item_2", "vector": [0.5, 0.6, 0.7, 0.8], "contents": "Bonjour!"},
    {"id": "item_3", "vector": [0.9, 0.10, 0.11, 0.12], "contents": "Hola!"}
]

index.upsert(items)

# Query the encrypted index
query_vector = [0.1, 0.2, 0.3, 0.4]
results = index.query(query_vector)

# Print the results
for result in results:
    print(f"ID: {result.id}, Distance: {result.distance}")
```

## Connecting to Different Backing Stores

### PostgreSQL

```python
index_location = cyborgdb.DBConfig(
    location="postgres",
    table_name="index_table", 
    connection_string="host=localhost dbname=cyborgdb_lite user=postgres password=postgres"
)
```

## Limitations

CyborgDB Lite is an evaluation version with the following limitations:

* **Maximum 1,000,000 encrypted embeddings**
* **Only 2 supported backing stores** (PostgreSQL & Memory)
* **Only 1 index type** (IVFFlat)
* **Maximum 4 CPU threads**
* **Non-commercial use only**

For production use or to remove these limitations, please upgrade to [CyborgDB Core](https://www.cyborg.co/contact-us).

## Documentation

For more detailed documentation, visit:
- [CyborgDB Documentation](https://docs.cyborg.co)
- [API Reference](https://docs.cyborg.co/versions/v0.9.x/api-reference/python/introduction)

## System Requirements

- Python 3.9 - 3.13
- Operating Systems: Linux, macOS, or WSL

## License

CyborgDB Lite is provided under a limited, evaluation-only license for non-commercial use. For commercial use, please contact [Cyborg](https://www.cyborg.co/contact) for licensing information.

## About Cyborg

Cyborg is dedicated to making AI safe and secure. We develop solutions that enable organizations to leverage AI while maintaining the confidentiality and privacy of their data.

[Visit our website](https://www.cyborg.co) | [Contact Us](https://www.cyborg.co/contact)