Skip to main content

ContextResource

Bases: object Full knowledge base access for modus.management.ModusManagement. mgmt.context.items.list() → Page[ContextItem] mgmt.context.items.get(uid) → ContextItem mgmt.context.items.update(uid, …) → ContextItem mgmt.context.items.delete(uid) → ContextItemDeletion mgmt.context.create_note(title, content) → CreatedContextItem mgmt.context.update_note(uid, title=…, body=…) → ContextItem mgmt.context.create_saved_query(name, query, …) → CreatedContextItem mgmt.context.update_saved_query(uid, name=…, …) → ContextItem mgmt.context.create_link(url, …) → CreatedContextItem mgmt.context.update_link(uid, title=…, url=…) → ContextItem

create_note()

Add a free-form text note to the Modus knowledge base.
  • Parameters:
    • title – Display title for the note.
    • content – Markdown body text.
  • Returns: Created item with its new uid.

update_note()

Update a note’s title and markdown body. Preserves server-owned fields (noteId, s3Key, …) on the existing content blob. Pass existing to skip a GET when you already have the item from a list call.

create_saved_query()

Save a SQL query to the Modus knowledge base.
  • Parameters:
    • name – Display name for the saved query.
    • query – SQL text (optional at create if you set it later).
    • connection_id – Data connection the query runs against.
    • description – Optional human-readable description.
    • path – Optional hierarchical path segments for organisation.
  • Returns: Created item with its new uid.

update_saved_query()

Update a saved query’s name, SQL, and optional connection metadata.
Add a URL to the Modus knowledge base.
  • Parameters:
    • url – Link target URL.
    • title – Optional display title.
    • is_crawl – When True, fetch and index page content.
    • page_limit – Maximum pages to crawl when is_crawl is True.
  • Returns: Created item with its new uid.
Update link metadata on an existing item. Merges title and/or url into the stored content blob. Does not re-fetch or re-crawl the URL.

AsyncContextResource

Bases: object

create_note()

Add a free-form text note to the Modus knowledge base.

update_note()

Update a note’s title and markdown body.

create_saved_query()

Save a SQL query to the Modus knowledge base. See the sync create_saved_query for argument details.

update_saved_query()

Update a saved query’s name, SQL, and optional connection metadata.
Add a URL to the Modus knowledge base. See the sync create_link for argument details.
Update link metadata on an existing item.

ContextItemsResource

Bases: object

list()

List context items in the knowledge base.
  • Parameters:
    • page_size – Items per page (default 25).
    • page_token – Opaque token from a previous page’s next_page_token.
    • context_type – Filter by type, e.g. "note", "link", "saved_query".
  • Returns: Page of context items.

get()

Retrieve a context item by its UID.
  • Parameters: uid – The item’s UUID.
  • Returns: The context item.
  • Raises: NotFoundError – if no item with this UID exists.

update()

Update a context item.
  • Parameters:
    • uid – UUID of the context item to update.
    • content – Replacement type-specific content, if changing it.
    • context_type – The item’s type (e.g. "note"). Required when content is supplied.
    • description – New description, if changing it.
    • user_feedback – Feedback verdict — "positive", "neutral", or "negative".
    • topics – Replacement topic tags. Pass [] to clear all tags.
    • update_mask – Comma-separated field names to clear. Name a field here and leave its argument unset to set it to null on the server; fields not named in the mask are left untouched.
Only the fields you pass are changed; omitted fields are left as-is.

delete()

Delete a context item from the knowledge base.
  • Parameters: uid – The item’s UUID.
  • Returns: Deletion confirmation with the removed item’s UID.

CustomContextItemsResource

Bases: object

list()

List custom context items in the organization.
  • Parameters:
    • page_size – Maximum items per page.
    • page_token – Cursor from a previous page.
    • search_query – Optional free-text filter.
    • topics – Optional topic filters.
  • Returns: A page of custom context items.

get()

Fetch one custom context item by uid.
  • Parameters: uid – Custom context item identifier.
  • Returns: The matching custom context item.

create()

Create a custom context item for an internal system or custom database.

batch_create()

Create or update a batch of custom context items by stable hierarchy.

update()

Update mutable fields on a custom context item.
  • Parameters:
    • uid – Custom context item identifier.
    • **payload – Fields to update, such as description or topics.
  • Returns: The update acknowledgement payload.

delete()

Delete a custom context item.
  • Parameters: uid – Custom context item identifier.
  • Returns: Deletion metadata for the removed item.