Nous.KnowledgeBase.Prompts (nous v0.17.1)

Copy Markdown View Source

LLM prompt templates for knowledge base compilation, linking, auditing, and output generation.

Every function here is pure: it takes already-loaded structs and returns the prompt string the workflow node sends to the compiler model.

Summary

Types

One row of the compact entry listing handed to audit_prompt/2.

Aggregate counts gathered by the health-check pipeline.

Functions

Builds a prompt for auditing the knowledge base.

Builds a prompt for compiling raw documents into wiki entries.

Builds a prompt for extracting concepts from raw documents.

Builds a prompt for generating links between wiki entries.

Builds a prompt for generating an output (report/summary/slides) from entries.

Types

entry_summary()

@type entry_summary() :: %{
  slug: String.t(),
  title: String.t(),
  entry_type: Nous.KnowledgeBase.Entry.entry_type(),
  confidence: float(),
  link_count: non_neg_integer()
}

One row of the compact entry listing handed to audit_prompt/2.

stats()

@type stats() :: %{
  total_entries: non_neg_integer(),
  total_links: non_neg_integer(),
  total_documents: non_neg_integer()
}

Aggregate counts gathered by the health-check pipeline.

Functions

audit_prompt(stats, entry_summaries)

@spec audit_prompt(stats(), [entry_summary()]) :: String.t()

Builds a prompt for auditing the knowledge base.

compilation_prompt(documents, concepts)

@spec compilation_prompt([Nous.KnowledgeBase.Document.t()], [map()]) :: String.t()

Builds a prompt for compiling raw documents into wiki entries.

extraction_prompt(documents)

@spec extraction_prompt([Nous.KnowledgeBase.Document.t()]) :: String.t()

Builds a prompt for extracting concepts from raw documents.

linking_prompt(entries)

@spec linking_prompt([Nous.KnowledgeBase.Entry.t()]) :: String.t()

Builds a prompt for generating links between wiki entries.

output_prompt(topic, entries, output_type)

@spec output_prompt(
  String.t(),
  [Nous.KnowledgeBase.Entry.t()],
  :report | :summary | :slides
) ::
  String.t()

Builds a prompt for generating an output (report/summary/slides) from entries.