Skip to main content
Python client library for the Skald API.

Installation

Requirements

  • Python 3.8 or higher

Usage

Initialize the client

Memo Management

Create a Memo

Create a new memo that will be automatically processed (summarized, tagged, chunked, and indexed for search):
Required Fields:
  • title (string, max 255 chars) - The title of the memo
  • content (string) - The full content of the memo
Optional Fields:
  • metadata (dict) - Custom JSON metadata
  • reference_id (string, max 255 chars) - An ID from your side that you can use to match Skald memo UUIDs with e.g. documents on your end
  • tags (list of strings) - Tags for categorization
  • source (string, max 255 chars) - An indication from your side of the source of this content, useful when building integrations
  • expiration_date (string) - ISO 8601 timestamp for automatic memo expiration

Get a Memo

Retrieve a memo by its UUID or your reference ID:
The get_memo() method returns complete memo details including content, AI-generated summary, tags, and content chunks. Memo Response Fields:
  • uuid - Unique identifier for the memo
  • title - Memo title
  • content - Full memo content
  • summary - AI-generated summary
  • pending - Boolean indicating if the memo is still being processed
  • archived - Boolean indicating if the memo is archived
  • type - Memo type (“document” or “text”)
  • metadata - Custom metadata object
  • tags - List of tag objects
  • chunks - List of content chunk objects

List Memos

List all memos with pagination:
Parameters:
  • page (int, optional) - Page number (default: 1)
  • page_size (int, optional) - Results per page (default: 20, max: 100)

Update a Memo

Update an existing memo by UUID or reference ID:
Note: When you update the content field, the memo will be automatically reprocessed (summary, tags, and chunks regenerated). Updatable Fields:
  • title (string)
  • content (string)
  • metadata (dict)
  • client_reference_id (string)
  • source (string)
  • expiration_date (string)

Delete a Memo

Permanently delete a memo and all associated data:
Warning: This operation permanently deletes the memo and all related data (content, summary, tags, chunks) and cannot be undone.

Check Memo Processing Status

After creating or updating a memo (especially when uploading files), it is automatically processed asynchronously (summarized, tagged, and chunked). Use the check_memo_status() method to check processing status:
Status Response Fields:
  • memo_uuid - The memo’s UUID
  • status - Processing state: “processing”, “processed”, or “error”
  • processing_started_at - ISO timestamp when processing started
  • processing_completed_at - ISO timestamp when processing completed (if finished)
  • error_reason - Error message if status is “error”
Note: Most memos are processed within a few seconds, but larger documents may take longer.

File Uploads

Upload documents (PDF, DOC, DOCX, PPTX) to your Skald knowledge base. Files are automatically processed to extract text, then summarized, tagged, chunked, and indexed for search.

Upload a Document

Supported File Types:
  • PDF (.pdf)
  • Microsoft Word (.doc, .docx)
  • Microsoft PowerPoint (.pptx)
File Size Limit: 100MB per file Parameters:
  • file_path (string, required) - Path to the file to upload
  • memo_data (dict, optional) - Optional metadata for the memo:
    • title (string) - Title for the memo
    • source (string) - Source system identifier
    • reference_id (string) - Your external reference ID
    • tags (list of strings) - Tags for categorization
    • metadata (dict) - Custom JSON metadata
    • expiration_date (string) - ISO 8601 timestamp for automatic memo expiration
Note: File processing is asynchronous and may take longer than text-based memos depending on file size and complexity. Use check_memo_status() to monitor processing progress.

Search Memos

Search through your memos using semantic search with optional filters:

Search Parameters

  • query (string, required) - The search query
  • limit (integer, optional) - Maximum results to return (1-50, default 10)
  • filters (list, optional) - List of filter objects to narrow results (see Filters section below)

Search Response

  • memo_uuid - Unique identifier for the memo
  • chunk_uuid - Unique identifier for the chunk
  • memo_title - Memo title
  • memo_summary - Auto-generated summary for the memo
  • content_snippet - A snippet containing content from the matching chunk
  • distance - A decimal from 0 to 2 determining how close the result was deemed to be to the query. The closer to 0 the more related the content is to the query.

Chat with Your Knowledge Base

Ask questions about your memos using an AI agent. The agent retrieves relevant context and generates answers with inline citations.

Non-Streaming Chat

Streaming Chat

For real-time responses, use streaming chat:

Chat Parameters

  • query (string, required) - The question to ask
  • filters (list, optional) - List of filter objects to focus chat context on specific sources (see Filters section below)

Chat Response

Non-streaming responses include:
  • ok (bool) - Success status
  • response (str) - The AI’s answer
  • intermediate_steps (list) - Steps taken by the agent (for debugging)
Streaming responses yield events:
  • {'type': 'token', 'content': str} - Each text token as it’s generated
  • {'type': 'done'} - Indicates the stream has finished

Filters

Filters allow you to narrow down results based on memo metadata. You can filter by native fields or custom metadata fields. Filters are supported in search(), chat(), and their streaming variants. See Filters for complete documentation.

Filter Structure

Native Fields

Native fields are built-in memo properties:
  • title - Memo title
  • source - Source system (e.g., “notion”, “confluence”)
  • client_reference_id - Your external reference ID
  • tags - Memo tags (list)

Custom Metadata Fields

You can filter on any field from the metadata dict you provided when creating the memo.

Filter Operators

  • eq - Equals (exact match)
  • neq - Not equals
  • contains - Contains substring (case-insensitive)
  • startswith - Starts with prefix (case-insensitive)
  • endswith - Ends with suffix (case-insensitive)
  • in - Value is in list (requires list value)
  • not_in - Value is not in list (requires list value)

Filter Examples

Combining Multiple Filters

When you provide multiple filters, they are combined with AND logic (all filters must match):

Filters with Chat

Focus chat context on specific sources:

Error Handling

Type Hints Support

This package includes full type hints for better IDE support and type checking.