Skip to main content
The client.semantic namespace manages the structured “Knowledge Graph” of your projects. Unlike episodic memory, which is a stream of events, semantic memory is used for organized facts, user preferences, and entity relationships.

Semantic Sets

Sets are the top-level containers for structured data within a project (e.g., a “User Preferences” set or a “Product Catalog” set).

create_set_type

Defines a new type of semantic set that can be instantiated.
client.semantic.create_set_type(
    org_id="my_org",
    project_id="my_proj",
    name="UserPreferences",
    description="Stores long-term user habits and settings"
)
ParameterTypeDescription
org_idstrOrganization identifier.
project_idstrProject identifier.
namestrUnique name for the set type.
descriptionstrOptional summary of the set’s purpose.

Categories

Categories live inside Sets and define specific schemas for the data being stored.

add_category

Adds a new category to an existing semantic set.
client.semantic.add_category(
    org_id="my_org",
    project_id="my_proj",
    set_id="set_123",
    name="DietaryRestrictions",
    template_id="v1_template"
)
ParameterTypeDescription
org_idstrOrganization identifier.
project_idstrProject identifier.
set_idstrThe ID of the parent Set.
namestrName of the category.
template_idstrOptional schema template for validation.

Tags

Tags are the individual “facts” or “labels” stored within a category.

add_tag

Adds a specific semantic tag to a category.
client.semantic.add_tag(
    org_id="my_org",
    project_id="my_proj",
    category_id="cat_456",
    value="Vegetarian",
    metadata={"confidence": 0.98}
)
ParameterTypeDescription
org_idstrOrganization identifier.
project_idstrProject identifier.
category_idstrThe ID of the parent Category.
valuestrThe actual tag content (e.g., “Vegetarian”).
metadatadictOptional key-value pairs for the tag.

Retrieval

get_features

Retrieves all semantic features (sets, categories, and tags) associated with a project or specific filter.
ParameterTypeDefaultDescription
org_idstrRequiredOrganization identifier.
project_idstrRequiredProject identifier.
filter_dictdictNoneFilter by specific tags or categories.

Deletion

delete_tag

Removes a specific tag from a category.
client.semantic.delete_tag(
    org_id="my_org",
    project_id="my_proj",
    tag_id="tag_789"
)
Deleting a Set Type will recursively delete all Categories and Tags associated with it. This action cannot be undone.