SchemaManager persistence API
The neo4j_agent_memory.schema.SchemaManager CRUD surface from Domain schemas reference. Signatures show types, keyword-only arguments (*), and defaults; they are reference declarations, not calls to execute directly.
SchemaManager persistence API (bolt)
The following methods belong to neo4j_agent_memory.schema.SchemaManager, constructed with a connected Neo4jClient. Its active schema version is persistence metadata; changing it does not reconfigure existing MemoryClient extractors. load_schema loads the active version; load_schema_version selects an explicit version.
save_schema
Save a schema to Neo4j.
async def save_schema(
schema: EntitySchemaConfig,
*,
created_by: str | None=None,
set_active: bool=True,
) -> StoredSchema: ...
| Parameter | Description |
|---|---|
|
The EntitySchemaConfig to save |
|
Optional identifier for who created this schema |
|
Whether to set this as the active version (default True) |
load_schema
Load the active schema by name.
async def load_schema(name: str) -> EntitySchemaConfig | None: ...
| Parameter | Description |
|---|---|
|
Schema name to load |
load_schema_version
Load a specific version of a schema.
async def load_schema_version(name: str, version: str) -> EntitySchemaConfig | None: ...
| Parameter | Description |
|---|---|
|
Schema name |
|
Schema version to load |
get_stored_schema
Get full stored schema details by name.
async def get_stored_schema(name: str) -> StoredSchema | None: ...
| Parameter | Description |
|---|---|
|
Schema name |
get_stored_schema_by_id
Get stored schema by ID.
async def get_stored_schema_by_id(schema_id: UUID | str) -> StoredSchema | None: ...
| Parameter | Description |
|---|---|
|
Schema UUID |
list_schemas
List all schemas or filter by name.
async def list_schemas(name: str | None=None) -> list[SchemaListItem]: ...
| Parameter | Description |
|---|---|
|
Optional schema name to filter by |
list_schema_versions
List all versions of a schema.
async def list_schema_versions(name: str) -> list[StoredSchema]: ...
| Parameter | Description |
|---|---|
|
Schema name |
set_active_version
Set a specific version as the active schema.
async def set_active_version(name: str, version: str) -> StoredSchema | None: ...
| Parameter | Description |
|---|---|
|
Schema name |
|
Version to set as active |
schema_exists
Check if a schema exists.
async def schema_exists(name: str) -> bool: ...
| Parameter | Description |
|---|---|
|
Schema name to check |
delete_schema
Delete a specific schema version by ID.
async def delete_schema(schema_id: UUID | str) -> bool: ...
| Parameter | Description |
|---|---|
|
Schema UUID to delete |
delete_all_versions
Delete all versions of a schema.
async def delete_all_versions(name: str) -> int: ...
| Parameter | Description |
|---|---|
|
Schema name to delete |
ensure_schema_index
Create index on Schema nodes for efficient lookups.
async def ensure_schema_index() -> None: ...
StoredSchema includes the stored record ID, name, version, active flag, creation timestamp, creator, and EntitySchemaConfig. Schema deletion removes schema records; it does not delete the memory entities previously extracted using them.