Skip to content

KnowledgeCompilerConfig

compile: (systemPrompt, userPrompt) => Promise<string>;

Function that calls the LLM to compile raw text into structured markdown. The compiler is model-agnostic — callers provide their own LLM function.

Parameter Type Description

systemPrompt

string

Instructions for compilation.

userPrompt

string

The raw text to compile.

Promise<string>

Compiled structured markdown.


optional maxTokens?: number;

Maximum token budget for the compiled output. The compiler instructs the LLM to stay within this limit. Default: 4000.


optional systemPrompt?: string;

Custom system prompt for the compilation LLM call. When not provided, a default prompt is used that produces structured markdown organized by topic with deduplication.