Official Nebula API SDK for Python. Provides typed async access to the public Nebula REST API: collections, memories, connectors, snapshots, and system health.
# Stable
pip install nebula-sdk
# Preview (next iteration, RC versions)
pip install --pre nebula-sdkPre-launch: The public surface is still being shaped. Plain semver releases (
1.6.0,1.7.0, …) are stable. Iteration ships as PEP 440 pre-release versions (1.6.0rc1,rc2, …) which pip's default resolver excludes —pip install nebula-sdkgets stable;--preopts in to the iteration channel. Version specifiers likenebula-sdk>=1.6.0,<2.0.0likewise exclude pre-releases unless the specifier itself names one.
import asyncio
from nebula import Nebula, ClientOptions
async def main() -> None:
async with Nebula(ClientOptions(api_key="...")) as client:
memory_id = await client.store_memory(
collection_id="01234567-...",
raw_text="hello, world",
)
results = await client.memories.search(body={"query": "hello"})
print(results)
asyncio.run(main())This SDK is async-first. If you need to call it from a sync context, wrap
each call with asyncio.run(...). A dedicated sync client is not currently
provided.
Pass your Nebula API key as api_key when constructing the client. It is sent
via the Authorization: Bearer header.
async with Nebula(ClientOptions(api_key="...")) as client:
...All HTTP errors map to a typed exception hierarchy:
NebulaBadRequestError(400)NebulaUnauthorizedError(401)NebulaForbiddenError(403)NebulaNotFoundError(404)NebulaConflictError(409)NebulaValidationError(422)NebulaRateLimitError(429) — carriesretry_afterwhen the server returnsRetry-AfterNebulaServerError(5xx)NebulaConnectionError/NebulaTimeoutError— transport-level
- API reference: https://docs.zeroset.com
- Migration notes: see
MIGRATION.mdin the source repo
MIT