Namespaces are required
Every write and every read takes anamespace. There is no default. Omitting it raises ValueError.
The dual-ID scheme
AMemoryNamespace carries two UUIDs. Knowing which is which is the key to using the API correctly:
The high-level facade (
kb.remember, kb.recall, kb.list_entities) takes the stable namespace_id and resolves it to the active version’s id automatically (one indexed, sub-millisecond lookup). The storage layer (kb.storage.*) takes a row id because each call is scoped to a specific version. Child rows (documents, chunks, entities) foreign-key to id, not namespace_id.
The isolation contract
Isolation isn’t post-filtering in Python. It’s enforced in the query layer and baked into the storage Protocol. Every read, exists-check, and mutation on every backend declares*, namespace_id: UUID as a required keyword-only argument and filters at the SQL WHERE / Cypher MATCH {namespace_id} layer.
Looking up an id that belongs to a different namespace returns None / False / an empty result straight from the query. Existence never leaks as a timing oracle:
Finding namespaces
Versioning
A namespace can have multiple versions under one stablenamespace_id, useful when you want to re-ingest a corpus with a better extractor, A/B-test a chunking change, or snapshot a graph before rebuilding it.
kb.storage.create_namespace_version(previous_version=…) increments the version, deactivates the previous version, and creates the new version as active. The swap is a single atomic step:
kb.storage.* by their row id. Keep them around for comparison or rollback until you’re confident in the new one.
See Workloads → Namespace versioning for a runnable end-to-end walkthrough of the dual-UUID model.
Per-namespace configuration
A namespace can override global settings, handy when one dataset needs a different embedding model or stricter thresholds. Overrides take priority over global config:Sync checkpoints
Each namespace tracks where it left off syncing from external sources, which is what makes incremental ingestion stateful:kb.storage.set_sync_checkpoint(namespace_id, source, value).
Storage backends
How the namespace-scoped rows are physically stored and routed.
Data model
What lives inside a namespace: documents, chunks, entities, events.