API Reference
Initialize KVStore
db_name values create separate key-value stores.
Methods
get(key: str) -> Optional[str]
Retrieve a value from the store. Returns None if the key doesn’t exist.
set(key: str, value: str) -> None
Store a string value. The value must be a string - use json.dumps() for objects.
Basic Example
Common Use Cases
Caching API Responses
Cache external API calls to reduce latency and costs:Caching Computation Results
Store results of expensive operations to avoid recomputation:Important Limitations
Use PostgreSQL/database instead when you need:
- Complex queries
- Relational data
- Strong consistency guarantees
- Transactions
Use /data volume instead when you need:
- Large files (>25 MB)
- Model weights or datasets
- File-based storage
/data volume.