Metadata-Version: 2.5
Name: swarmv
Version: 1.2.0
Summary: Python SDK for SwarmV: edge vector memory with built-in access control for AI agents.
Project-URL: Homepage, https://edgevec.pages.dev
Project-URL: Documentation, https://edgevec.pages.dev/docs
License-Expression: MIT
Keywords: agents,ai,embeddings,memory,rag,vector,vector-database
Requires-Python: >=3.9
Requires-Dist: httpx[http2]>=0.27
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Provides-Extra: fast
Requires-Dist: numpy>=1.21; extra == 'fast'
Requires-Dist: orjson>=3.9; extra == 'fast'
Description-Content-Type: text/markdown

# SwarmV Python SDK

```bash
pip install "swarmv[fast]"   # [fast] adds orjson + numpy for max throughput
```

```python
from swarmv import SwarmV

with SwarmV(api_key="...") as vec:
    vec.insert({"id": "1", "vector": embedding, "metadata": {"lang": "en"}})  # ids: numeric strings
    results = vec.search(query_embedding, top_k=5, filter={"lang": "en"})
    vec.delete("1")
```

Async, with concurrent batching:

```python
from swarmv import AsyncSwarmV

async with AsyncSwarmV(api_key="...") as vec:
    batches = await vec.search_many(queries, top_k=5, concurrency=64)
    await vec.insert_many(records)
```

Feature parity with the TypeScript SDK: `insert`, `search` (`top_k`, `nprobe`, `filter`),
`delete`, and `SemanticCache` (plus `AsyncSemanticCache`). Python-only extras:
`insert_many`, `search_many`, numpy input.

Temporary failures (429, 5xx including "write backlog full" during heavy bulk loads, network errors)
are retried automatically, waiting as long as the server's `Retry-After` asks: `max_retries=6` by
default. Indexes grow to 1,000,000 vectors (split into shards automatically past 100,000); see
https://edgevec.pages.dev/docs for limits and errors.

Performance: pooled HTTP/2 keep-alive connections, optional orjson, no per-element
Python loops for numpy arrays. Reuse one client per process.
