FastAPI endpoint functions for managing memory collection resources.
Attributes
module-attribute
  
collections_router = APIRouter(
    prefix=format_path(RESOURCE_COLLECTIONS),
    tags=[RESOURCE_COLLECTIONS],
    responses=DEFAULT_HTTP_ERROR_RESPONSES,
)
Classes
Functions
async
  
create_collection(
    fastapi_request: Request,
    request: CollectionCreateRequestV1,
    namespace_pkid: str = namespace_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Create a new collection in the namespace
async
  
export_memories(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Export all memories in a collection to JSON
async
  
generate_all_collection_graphs(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Generates graphs for all collections in the namespace
async
  
generate_collection_graph(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Generates graph for a collection
async
  
get_collection(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Get a collection resource
async
  
hard_delete_collection(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    dry_run: bool = dry_run_query_param,
    delete_vectors: bool = Query(
        default=True,
        title="Delete Vectors",
        description="When set to true, vector data will also be deleted",
    ),
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Hard delete a collection resource and associated memories
async
  
list_collections(
    fastapi_request: Request,
    namespace_pkid: str = namespace_path_param,
    include_deleted: bool = Query(
        False,
        description="Include deleted memory collections in the response",
    ),
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
List all collections in the namespace
async
  
rebuild_all_collections(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    queue: str | None = checkmate_queue_query_param,
    tags: List[str] | None = checkmate_tags_query_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Rebuilds all memory collection in a namespace. This method will disable agents temporarily as their memory collections are rebuilt.
async
  
rebuild_collection(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Rebuilds a memory collection
async
  
soft_delete_collection(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Soft delete a collection resource
async
  
truncate_collection(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Hard delete all memories in the collection (truncate), the collection itself is not deleted. This action is immediate and irreversible.
async
  
undelete_collection(
    fastapi_request: Request,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Undeletes a soft-deleted collection resource
async
  
update_collection(
    fastapi_request: Request,
    request: CollectionUpdateRequestV1,
    namespace: str = namespace_path_param,
    memory_collection: str = collection_path_param,
    job_pool: ThreadPoolExecutor = Depends(
        job_pool_dependency
    ),
)
Update a collection resource