Nous.KnowledgeBase.Document (nous v0.17.1)

Copy Markdown View Source

A raw ingested document before compilation into wiki entries.

Documents represent source material (markdown, text, URLs, etc.) that gets processed by the LLM into structured Entry wiki articles.

Summary

Functions

Computes SHA-256 checksum of content for change detection.

Creates a new Document from attributes.

Types

doc_type()

@type doc_type() :: :markdown | :text | :url | :pdf | :html

status()

@type status() :: :pending | :processing | :compiled | :failed

t()

@type t() :: %Nous.KnowledgeBase.Document{
  checksum: String.t(),
  compiled_entry_ids: [String.t()],
  content: String.t(),
  created_at: DateTime.t(),
  doc_type: doc_type(),
  id: String.t(),
  kb_id: String.t() | nil,
  metadata: map(),
  source_path: String.t() | nil,
  source_url: String.t() | nil,
  status: status(),
  title: String.t(),
  updated_at: DateTime.t()
}

Functions

compute_checksum(content)

@spec compute_checksum(String.t()) :: String.t()

Computes SHA-256 checksum of content for change detection.

new(attrs)

@spec new(map()) :: t()

Creates a new Document from attributes.

Requires :content and :title. Auto-generates id, checksum, and timestamps.