# `Nous.KnowledgeBase.Document`
[🔗](https://github.com/nyo16/nous/blob/v0.17.1/lib/nous/knowledge_base/document.ex#L1)

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.

# `doc_type`

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

# `status`

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

# `t`

```elixir
@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()
}
```

# `compute_checksum`

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

Computes SHA-256 checksum of content for change detection.

# `new`

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

Creates a new Document from attributes.

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
