Skip to main content
.NET/C# client library for the Skald API.

Installation

Requirements

  • .NET 8.0 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 (Dictionary<string, object>) - Custom JSON metadata
  • ReferenceId (string, max 255 chars) - An ID from your side that you can use to match Skald memo UUIDs with documents on your end
  • Tags (List<string>) - Tags for categorization
  • Source (string, max 255 chars) - An indication of the source of this content, useful when building integrations
  • ExpirationDate (string) - ISO 8601 timestamp for automatic memo expiration

Get a Memo

Retrieve a memo by its UUID or your reference ID:
The GetMemoAsync() 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 (Dictionary<string, object>)
  • ClientReferenceId (string)
  • Source (string)
  • ExpirationDate (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.

Search Memos

Search through your memos using various search methods with optional filters:

Search Methods

  • ChunkVectorSearch - Semantic search on memo chunks for detailed content search
  • TitleContains - Case-insensitive substring match on memo titles
  • TitleStartswith - Case-insensitive prefix match on memo titles

Search Parameters

  • Query (string, required) - The search query
  • SearchMethod (SearchMethod, required) - One of the search methods above
  • Limit (int, optional) - Maximum results to return (1-50, default 10)
  • Filters (List<Filter>, optional) - Array of filter objects to narrow results

Search Response

  • Distance - A decimal from 0 to 2 determining how close the result was deemed to be to the query when using semantic search. The closer to 0 the more related the content is to the query. null if using TitleContains or TitleStartswith.

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<Filter>, optional) - Array of filter objects to focus chat context on specific sources

Chat Response

Non-streaming responses include:
  • Ok (bool) - Success status
  • Response (string) - The AI’s answer
  • IntermediateSteps (List<object>) - Steps taken by the agent (for debugging)
Streaming responses yield events:
  • { Type = "token", Content = "..." } - 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 SearchAsync(), ChatAsync(), GenerateDocAsync(), and their streaming variants.

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 object 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 array (requires array value)
  • NotIn - 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:

Filters with Document Generation

Control which memos are used for document generation:

Error Handling

Using Custom HttpClient

If you need to customize the HTTP client (e.g., for proxy settings, custom timeout, or other configurations):

Examples

For complete working examples, see the examples directory in the GitHub repository.

GitHub Repository

https://github.com/skaldlabs/skald-csharp