Skip to main content

Crate cognee_http_server

Crate cognee_http_server 

Source
Expand description

Cognee HTTP server library — OSS surface.

Provides RouterBuilder (the embedder-facing injection seam) and a free-function build_router shorthand. Closed embedders use RouterBuilder to splice the moved auth / api-keys / users / sync / checks / permissions routers back onto the OSS surface and to install an AuthResolver / ExtraAuthValidator against the AuthenticatedUser extractor.

Pure-OSS callers (and tests) use build_router(state) which is equivalent to RouterBuilder::new(state).build().

The standalone cognee-http-server binary is a thin shell over build_router + axum::serve.

Re-exports§

pub use config::HttpServerConfig;
pub use error::ApiError;
pub use error::ServerError;
pub use state::AppState;

Modules§

auth
Slim OSS auth module. The full closed auth/ subtree (JWT, cookie, API key, register/reset/verify, password hashing, mailer, superuser-only extractor, AuthContext, etc.) lives in the closed cognee-http-cloud crate alongside the auth router family. OSS keeps only the in-extractor types and the default-user fallback.
auth_resolver
Injection seam for closed-side authentication.
cloud_client
components
ComponentHandles — pre-built component instances passed to P2 handlers.
config
HTTP server configuration.
dto
Data Transfer Objects (DTOs) for the cognee HTTP server.
error
Error types for the cognee HTTP server.
health
Real HealthChecker implementation — probes the live backends behind ComponentHandles and aggregates them into a HealthCheckReport.
lifecycle
Server startup and shutdown lifecycle hooks.
middleware
Tower middleware layers for the cognee HTTP server.
multipart
Shared multipart-body parsing helpers.
notebook_runner
Notebook cell execution backend for POST /api/v1/notebooks/{notebook_id}/{cell_id}/run.
observability
In-process observability tier — span buffer, redaction, and the tracing layer that feeds them.
openapi
OpenAPI document assembly via utoipa.
permissions
Permission-gate helpers used across the write-path routers.
pipelines
HTTP-server-side pipeline dispatch machinery.
responses
Response helpers for the cognee HTTP server.
responses_dispatch
Function-call dispatcher for POST /api/v1/responses.
routers
HTTP router modules — one file per FastAPI router.
state
Application state — a single Clone-able struct injected into every handler via axum::extract::State.
sync
In-memory sync registry — one running cloud sync per user.
telemetry
Per-endpoint product-analytics emission helper.
wiring
Construct default standalone backend handles for the HTTP server binary.

Structs§

RouterBuilder
Builder for the full axum::Router. Closed embedders use this to inject extra routers (e.g. the auth/permissions families) and to install an AuthResolver against the AuthenticatedUser extractor.

Functions§

build_router
Assemble the full axum::Router with no extra routers — equivalent to RouterBuilder::new(state).build().
run
Bind addr, build the router, and serve until a shutdown signal.