Skip to main content

Module compile

Module compile 

Source
Expand description

Knowledge distillation pipeline: fragments → structured knowledge pages.

Clusters related lifecycle records and synthesizes them into reusable knowledge pages (memory_type: “knowledge”, source_kind: Distilled).

§Phase 2: LLM-assisted synthesis

When a SamplingClient is available (MCP session with sampling capability), synthesize_with_sampling sends fragment clusters to the LLM for intelligent synthesis. The LLM produces structured knowledge pages with proper sections, cross-references, and synthesized insights. Falls back to template synthesis when sampling is unavailable or fails.

Structs§

CrystallizeResult
Result of a crystallize operation (LLM or template).
KnowledgePageDraft

Functions§

apply_distill
Persist knowledge page drafts as candidate records in the ledger.
auto_compile_from_config
Auto-compile 入口: 在 lifecycle write 之后检测新可合并集群,auto-propose 为 candidate。
detect_knowledge_clusters
Detect clusters of fragments and synthesize knowledge page drafts.
synthesize_with_sampling
Synthesize knowledge pages from detected clusters using an LLM via the MCP sampling reverse-call. Falls back to template synthesis when sampling is unavailable or returns an unparseable response.