# `Gralkor.Ingest`
[🔗](https://github.com/elimydlarz/jido_gralkor/blob/main/lib/gralkor/ingest.ex#L1)

A request to ingest content through a registered `Gralkor.Lens`.

`id` is the caller's non-blank, replay-stable identity for this logical
ingestion. A consumer may reuse it as the invocation identity for a related
Reflection. `operator_id` identifies the operator whose local Lens group is
used; global Lenses ignore it for storage placement. `lens` is the registered
Lens name.
Gralkor resolves that definition before invoking its ingestion process, so
callers provide content and source context rather than ontology or group
details. `source_kind` is the deterministic origin enum: conversations and
documents carry text, while structured records carry a JSON-compatible map
or list. It describes provenance, not credibility or truth.

# `source_kind`

```elixir
@type source_kind() :: :conversation | :document | :structured_record
```

# `t`

```elixir
@type t() ::
  %Gralkor.Ingest{
    content: String.t(),
    id: String.t(),
    lens: String.t(),
    operator_id: String.t(),
    source_description: String.t(),
    source_kind: :conversation
  }
  | %Gralkor.Ingest{
      content: String.t(),
      id: String.t(),
      lens: String.t(),
      operator_id: String.t(),
      source_description: String.t(),
      source_kind: :document
    }
  | %Gralkor.Ingest{
      content: map() | list(),
      id: String.t(),
      lens: String.t(),
      operator_id: String.t(),
      source_description: String.t(),
      source_kind: :structured_record
    }
```

# `encode_content!`

```elixir
@spec encode_content!(source_kind(), String.t() | map() | list()) :: String.t()
```

# `validate_id!`

```elixir
@spec validate_id!(term()) :: :ok
```

# `validate_operator_id!`

```elixir
@spec validate_operator_id!(term()) :: :ok
```

# `validate_source!`

```elixir
@spec validate_source!(source_kind() | term(), term()) :: :ok
```

---

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