Installation
Requirements
- Node 18.0.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):title(string, max 255 chars) - The title of the memocontent(string) - The full content of the memo
project_id(string) - Project UUID (required when using Token Authentication)metadata(object) - Custom JSON metadatareference_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 endtags(array of strings) - Tags for categorizationsource(string, max 255 chars) - An indication from your side of the source of this content, useful when building integrationsexpiration_date(string) - ISO 8601 timestamp for automatic memo expiration
Create a Memo from File Upload
Upload a document file (PDF, DOC, DOCX, PPTX) that will be processed asynchronously and converted into a memo:- PDF (.pdf)
- Microsoft Word (.doc, .docx)
- Microsoft PowerPoint (.pptx)
- Maximum file size: 100MB
file(Buffer | Blob) - The file contentfilename(string) - The name of the file including extension
reference_id(string, max 255 chars) - Your external reference IDmetadata(object) - Custom JSON metadatatags(array of strings) - Tags for categorizationsource(string, max 255 chars) - Source system identifier
checkMemoStatus() to monitor the processing status.
Check Memo Processing Status
Monitor the processing status of a memo, especially useful after uploading files:processing- The memo is currently being processed (parsed, summarized, chunked, indexed)processed- Processing completed successfully, memo is ready to useerror- An error occurred during processing, checkerror_reasonfor details
memoId(string, required) - The memo UUID or client reference IDidType(string, optional) - Either'memo_uuid'or'reference_id'(default:'memo_uuid')
Get a Memo
Retrieve a memo by its UUID or your reference ID:getMemo() method returns complete memo details including content, AI-generated summary, tags, and content chunks.
List Memos
List all memos with pagination:page(number, optional) - Page number (default: 1)page_size(number, optional) - Results per page (default: 20, max: 100)
Update a Memo
Update an existing memo by UUID or reference ID:content field, the memo will be automatically reprocessed (summary, tags, and chunks regenerated).
Updatable Fields:
title(string)content(string)metadata(object)client_reference_id(string)source(string)expiration_date(string)
Delete a Memo
Permanently delete a memo and all associated data:Search Memos
Search through your memos using semantic search:Search Parameters
query(string, required) - The search querylimit(integer, optional) - Maximum results to return (1-50, default 10)filters(array, optional) - Array of filter objects to narrow results (see Filters section below)
Search Response
memo_uuid- Unique identifier for the memomemo_uuid- Unique identifier for the chunkmemo_title- Memo titlememo_summary- Auto-generated summary for the memocontent_snippet- A snippet containing the beginning of the chunk content.distance- A decimal from 0 to 2 determining how close the result was deemed to be to the query when using semantic search (chunk_vector_search). The closer to 0 the more related the content is to the query.nullif usingtitle_containsortitle_startswith.
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 asksystem_prompt(string, optional) - A system prompt to guide the AI’s behaviorfilters(array, optional) - Array of filter objects to focus chat context on specific sources (see Filters section below)project_id(string, optional) - Project UUID (required when using Token Authentication)
Chat Response
Non-streaming responses include:ok(boolean) - Success statusresponse(string) - The AI’s answerintermediate_steps(array) - Steps taken by the agent (for debugging)
{ 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 insearch(), chat(), generateDoc(), and their streaming variants.
See Filters for complete documentation.
Filter Structure
Native Fields
Native fields are built-in memo properties:title- Memo titlesource- Source system (e.g., “notion”, “confluence”)client_reference_id- Your external reference IDtags- Memo tags (array)
Custom Metadata Fields
You can filter on any field from themetadata object you provided when creating the memo.
Filter Operators
eq- Equals (exact match)neq- Not equalscontains- Contains substring (case-insensitive)startswith- Starts with prefix (case-insensitive)endswith- Ends with suffix (case-insensitive)in- Value is in array (requires array value)not_in- 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:Scopes
Scopes provide strict data isolation for multi-tenant applications.Creating Memos with Scopes
Querying with Scopes
When usingchat() or search(), provide the same scopes to access scoped content:
chat will query all memos for its context. However, if you pass any scopes, only memos that match exactly the scopes will be included in the context.
You must include all relevant scopes in order for them to have effect. Scopes operate on an AND basis.
For example, a memo with scopes: { organizationId: '123', admin: 'true' } will behave as follows:
- If the query includes
{ organizationId: '123', admin: 'true' }, the memo will be included in the context. - If the query includes
{ organizationId: '123' }, the memo will be included in the context. - If the query includes
{ admin: 'true' }, the memo will be included in the context. - If the query includes
{ organizationId: '123', admin: false }, the memo will not be included in the context.