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.0

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.0
File Size Uploaded Provenance Actions
zerodb_fastapi-0.1.0.tar.gz 6.7 kB Without provenance Details for zerodb_fastapi-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 14.0 kB

Release files / zerodb_fastapi-0.1.0.tar.gz

Download URL zerodb_fastapi-0.1.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ff3b37bf908dc1fa3bcc947dfd84f9484c9c838d542a5a8cc18a2e568d286f40
BLAKE2b-256 checksum
How to use checksums
a80976c2f7e286859e2ac585d90950443c12a73d10fab59d75bb079650ac6290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

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

Download URL zerodb_fastapi-0.1.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59d9d1a4b91378b2ffddf2ac222e866631df11098cbef42b11bf8c7ff24e13f0
BLAKE2b-256 checksum
How to use checksums
f16139a1ba1bd388e98899441f88e31ef3fda38f024bdb722f658ee9c4bcbecd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for zerodb-fastapi 0.1.0

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.0 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