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

Installation

Requirements

  • Go 1.18 or higher

Usage

Initialize the client

You can optionally specify a custom base URL (e.g., for self-hosted instances):

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 (map[string]interface) - Custom JSON metadata
  • ReferenceID (*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 ([]string) - Tags for categorization
  • Source (*string, max 255 chars) - An indication from your side of the source of this content, useful when building integrations
  • ExpirationDate (*time.Time) - Timestamp for automatic memo expiration

Create a Memo from File

Upload a document file to create a memo. Supported formats include PDF, DOC, DOCX, and PPTX (max 100MB):
Parameters:
  • filePath (string, required) - Path to the file to upload
  • memoData (*MemoFileData, optional) - Optional metadata for the memo
MemoFileData Fields (all optional):
  • Title (*string, max 255 chars) - The title of the memo
  • Source (*string, max 255 chars) - Source identifier
  • ReferenceID (*string, max 255 chars) - Your external reference ID
  • Tags ([]string) - Tags for categorization
  • Metadata (map[string]interface) - Custom JSON metadata
  • ExpirationDate (*time.Time) - Timestamp for automatic memo expiration
Note: File uploads are processed asynchronously. Use CheckMemoStatus() to monitor processing status.

Check Memo Processing Status

Monitor the processing status of a memo, especially useful after uploading files:
Status Values:
  • MemoStatusProcessing - The memo is currently being processed
  • MemoStatusProcessed - The memo has been successfully processed and is ready
  • MemoStatusError - Processing failed (check ErrorReason field for details)
Example: Polling for completion

Get a Memo

Retrieve a memo by its UUID or your reference ID:
The GetMemo() method returns complete memo details including content, AI-generated summary, tags, and content chunks.

List Memos

List all memos with pagination:
Parameters:
  • Page (*int, optional) - Page number (default: 1)
  • PageSize (*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 (map[string]interface)
  • ClientReferenceID (*string)
  • Source (*string)
  • ExpirationDate (*time.Time)

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.

Search Memos

Search through your memos using semantic search with optional filters:

Search Parameters

  • Query (string, required) - The search query
  • Limit (*int, optional) - Maximum results to return (1-50, default 10)
  • Filters ([]Filter, optional) - Array of filter objects to narrow results (see Filters section below)

Search Response

  • UUID - Unique identifier for the memo
  • Title - Memo title
  • Summary - Auto-generated summary for the memo
  • ContentSnippet - A snippet containing the beginning of the memo
  • Distance - A decimal from 0 to 2 determining how close the result was deemed to be 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
  • system_prompt (string, optional) - A system prompt to guide the chat agent’s behavior
  • filters ([]Filter, optional) - Array 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 (string) - The AI’s answer
  • IntermediateSteps ([]interface) - Steps taken by the agent (for debugging)
Streaming responses yield events:
  • { Type: "token", Content: *string } - 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 (array)

Custom Metadata Fields

You can filter on any field from the Metadata map you provided when creating the memo.

Filter Operators

  • FilterOperatorEq - Equals (exact match)
  • FilterOperatorNeq - Not equals
  • FilterOperatorContains - Contains substring (case-insensitive)
  • FilterOperatorStartsWith - Starts with prefix (case-insensitive)
  • FilterOperatorEndsWith - Ends with suffix (case-insensitive)
  • FilterOperatorIn - Value is in array (requires array value)
  • FilterOperatorNotIn - Value is not in array (requires array 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 Definitions

The SDK exports the following types for use in your Go code:
See the types.go file for complete type definitions.

Complete Example