Skip to main content

zerodb-fastapi

FastAPI integration for ZeroDB — router, middleware, and dependency injection helpers.

Installation

pip install zerodb-fastapi

Quick Start

from fastapi import FastAPI, Depends
from zerodb_fastapi import ZeroDBMiddleware, ZeroDBRouter, ZeroDBClient, get_zerodb

app = FastAPI()

# Add middleware to inject ZeroDB client into every request
app.add_middleware(
    ZeroDBMiddleware,
    api_key="your-api-key",
    project_id="your-project-id",
)

# Option 1: Use the pre-built router
zerodb_router = ZeroDBRouter(prefix="/zerodb")
app.include_router(zerodb_router.router)
# Provides: GET /zerodb/health, POST /zerodb/remember, POST /zerodb/recall, POST /zerodb/search

# Option 2: Use dependency injection in your own routes
@app.get("/my-search")
async def my_search(zerodb: ZeroDBClient = Depends(get_zerodb)):
    results = await zerodb.recall("search query", top_k=5)
    return results

Components

ZeroDBMiddleware

Starlette middleware that creates a shared ZeroDBClient and injects it into request.state.zerodb.

ZeroDBRouter

Pre-configured APIRouter with these endpoints:

  • GET /health — ZeroDB API health check
  • POST /remember — Store a memory
  • POST /recall — Recall memories by query
  • POST /search — Semantic search

Dependencies

  • get_zerodb(request) — Retrieve the ZeroDB client from request state
  • get_memory(request) — Alias for get_zerodb() for memory-focused usage

License

MIT

Metadata

Release files for zerodb-fastapi 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zerodb-fastapi 0.1.1
File Size Uploaded Provenance Actions
zerodb_fastapi-0.1.1.tar.gz 7.9 kB Without provenance Details for zerodb_fastapi-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zerodb-fastapi 0.1.1
File Interpreter ABI Platform Actions
zerodb_fastapi-0.1.1-py3-none-any.whl Python 3 none any Details for zerodb_fastapi-0.1.1-py3-none-any.whl

Total release size: 16.5 kB

Release files / zerodb_fastapi-0.1.1.tar.gz

Download URL zerodb_fastapi-0.1.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6979aa1bacbf32e00ef578401ab146ebbb2e9ad5cbf824958662cbe0d4443519
BLAKE2b-256 checksum
How to use checksums
b165549d8871e592136b86bd984ab0b68d38a33798f1dd5e1c4ac03676150d78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Release files / zerodb_fastapi-0.1.1-py3-none-any.whl

Download URL zerodb_fastapi-0.1.1-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eddf540bd96306385459d726fb22802e16dc5f9206f4c56fb6af33888cfd56a6
BLAKE2b-256 checksum
How to use checksums
0e453f5b12b7e7dc6fdb8be3e954307d24d304460dc9efd0b30197170a0a3852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Security for zerodb-fastapi 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page