This release is a pre-release and may not be stable for production use.
recall-sdk-python
Python SDK for VecLabs Recall — decentralized vector memory for AI agents.
Install
pip install solvec --pre
Quick Start
from solvec import SolVec
sv = SolVec(api_key="your-api-key")
collection = sv.collection("agent-memory", dimensions=1536)
# Upsert vectors
collection.upsert([{
"id": "mem_001",
"values": [...],
"metadata": {"text": "User prefers dark mode"}
}])
# Query
results = collection.query(vector=[...], top_k=5)
# Verify collection integrity against on-chain Merkle root
proof = collection.verify()
print(proof.solana_explorer_url)
Authentication
Get an API key at app.veclabs.xyz.
import os
from solvec import SolVec
sv = SolVec(api_key=os.environ["RECALL_API_KEY"])
Self-hosted with Shadow Drive (bring your own Solana wallet):
sv = SolVec(
network="devnet",
wallet="~/.config/solana/id.json",
shadow_drive=True
)
API Reference
SolVec(api_key?, network?, wallet?, shadow_drive?)
Creates a client. Use api_key for hosted mode or wallet + shadow_drive=True for self-hosted.
sv.collection(name, dimensions?)
Returns a collection handle. Creates the collection on first write. dimensions required on first write, inferred after.
collection = sv.collection("my-collection", dimensions=1536)
collection.upsert(vectors)
Insert or update vectors. Each vector requires id and values. metadata is optional.
collection.upsert([
{"id": "v1", "values": [...], "metadata": {"source": "gpt-4"}},
{"id": "v2", "values": [...]}
])
After every upsert, a SHA-256 Merkle root of all vector IDs is posted to the Solana Anchor program on-chain.
collection.query(vector, top_k?, metric?)
Nearest-neighbor search. Returns top-k results with scores and metadata.
results = collection.query(
vector=[...],
top_k=10, # default: 10
metric="cosine" # cosine (default), euclidean, dot
)
for match in results.matches:
print(match.id, match.score, match.metadata)
collection.delete(ids)
Delete vectors by ID.
collection.delete(["v1", "v2"])
collection.verify()
Fetches the on-chain Merkle root from Solana and verifies it against the current collection state.
proof = collection.verify()
print(proof.valid) # bool
print(proof.on_chain_root) # str
print(proof.computed_root) # str
print(proof.solana_explorer_url) # str
collection.stats()
Returns collection statistics.
stats = collection.stats()
print(stats.vector_count) # int
print(stats.dimensions) # int
print(stats.merkle_root) # str
Migrating from Pinecone
The API is intentionally shaped to match Pinecone's client. Migration is three line changes:
# Before
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_KEY")
index = pc.Index("my-index")
# After
from solvec import SolVec
sv = SolVec(api_key="YOUR_KEY")
index = sv.collection("my-index")
# Everything below stays identical
index.upsert(vectors=[...])
index.query(vector=[...], top_k=10)
index.verify() # new — Pinecone has no equivalent
Usage with LangChain
from langchain.vectorstores import VecLabsRecall
from langchain.embeddings import OpenAIEmbeddings
vectorstore = VecLabsRecall(
api_key="your-api-key",
collection="langchain-memory",
embedding=OpenAIEmbeddings()
)
vectorstore.add_texts(["User prefers dark mode", "Meeting at 3pm"])
docs = vectorstore.similarity_search("user preferences", k=5)
LangChain integration is in progress. Star the repo to follow along.
Development
git clone https://github.com/veclabs/recall-sdk-python
cd recall-sdk-python
pip install hatch
hatch build
pytest tests/ -v # 48 tests
Status
| Feature | Status |
|---|---|
| Hosted API (api key mode) | ✅ Live |
| Shadow Drive (self-host) | ✅ Available — shadow_drive=True |
| Merkle verification | ✅ Complete |
| TypeScript parity | ✅ 48/48 tests — full parity |
| LangChain integration | 📋 In progress |
| LlamaIndex integration | 📋 Planned |
| AutoGen integration | 📋 Planned |
Related
- Rust core engine →
veclabs/recall - TypeScript SDK →
veclabs/recall-sdk-js - Hosted API → api.veclabs.xyz
- Dashboard → app.veclabs.xyz
Contributing
See CONTRIBUTING.md.
Priority: LangChain integration, LlamaIndex integration, AutoGen integration.
License
MIT. See LICENSE.
Metadata
Release files for solvec 0.1.0a10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| solvec-0.1.0a10.tar.gz | 23.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| solvec-0.1.0a10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.0 kB
Release files / solvec-0.1.0a10.tar.gz
| Download URL | solvec-0.1.0a10.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
418ee8e5f505812c309ac003ed464dd74409c4291e3001a0e5059c1cf23e49a0
|
|
BLAKE2b-256 checksum How to use checksums |
e80cddad67cf1bbc88134472244f2179e7e9a7466ebe7045fbde38a8ef4daef9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / solvec-0.1.0a10-py3-none-any.whl
| Download URL | solvec-0.1.0a10-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b04a88e31800d8c0be51cdf31ead62c9073192af590310369590bb36ac16a618
|
|
BLAKE2b-256 checksum How to use checksums |
eeb37df7a10c21ca1cc22cfdfc91cf56ea89a53f269dbb8d3466d4e68499f05c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for solvec 0.1.0a10
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.