DatagroutConduit.Logic (DataGrout Conduit v0.6.0)

Copy Markdown View Source

Persistent agent memory backed by a Prolog logic cell.

Summary

Functions

Add a constraint rule (data-grout/logic.constrain).

Export the logic cell contents (data-grout/logic.export).

Retract facts from the logic cell (data-grout/logic.forget).

Hydrate the logic cell from external data (data-grout/logic.hydrate).

Import facts into the logic cell (data-grout/logic.import).

Query the logic cell (data-grout/logic.query).

Reflect on the logic cell (data-grout/logic.reflect).

Assert facts into the logic cell (data-grout/logic.remember).

Tabulate logic cell contents (data-grout/logic.tabulate).

Manage hypothetical worlds (data-grout/logic.worlds).

Functions

constrain(client, opts \\ %{})

@spec constrain(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Add a constraint rule (data-grout/logic.constrain).

Params

  • "rule" - Natural language rule (required)
  • "tag" - Tag/namespace (default: "constraint")

export_cell(client, opts \\ %{})

@spec export_cell(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Export the logic cell contents (data-grout/logic.export).

forget(client, opts \\ %{})

@spec forget(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Retract facts from the logic cell (data-grout/logic.forget).

Params

  • "handles" - Specific fact handles to retract
  • "pattern" - Pattern to match and retract facts

hydrate(client, opts \\ %{})

@spec hydrate(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Hydrate the logic cell from external data (data-grout/logic.hydrate).

import_cell(client, opts \\ %{})

@spec import_cell(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Import facts into the logic cell (data-grout/logic.import).

query(client, opts \\ %{})

@spec query(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Query the logic cell (data-grout/logic.query).

Params

  • "question" - Natural language question (mutually exclusive with "patterns")
  • "patterns" - Pre-built pattern list (mutually exclusive with "question")
  • "limit" - Maximum results (default: 50)

reflect(client, opts \\ %{})

@spec reflect(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Reflect on the logic cell (data-grout/logic.reflect).

Params

  • "entity" - Optional entity name to scope reflection
  • "summary_only" - Return only counts (default: false)

remember(client, opts \\ %{})

@spec remember(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Assert facts into the logic cell (data-grout/logic.remember).

Params

  • "statement" - Natural language statement (mutually exclusive with "facts")
  • "facts" - Pre-structured fact list (mutually exclusive with "statement")
  • "tag" - Tag/namespace for grouping facts (default: "default")

tabulate(client, opts \\ %{})

@spec tabulate(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Tabulate logic cell contents (data-grout/logic.tabulate).

worlds(client, opts \\ %{})

@spec worlds(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}

Manage hypothetical worlds (data-grout/logic.worlds).