{
  "access": "public",
  "type": "reference",
  "format": "markdown",
  "title": "Latent Tools Reference",
  "chunked": true,
  "url": "https://library.datagrout.ai/latent-tools",
  "summary": "Expand concepts into rich conceptual landscapes for research, context priming, and cross-domain exploration.",
  "content_markdown": "# Latent Tools\n\nExpand concepts into rich conceptual landscapes for research, context priming, and cross-domain exploration.\n\nLatent is often the first pass: use `latent.expand` to widen or deepen the idea space, then use `latent.orient` and `latent.horizon` to navigate that space with angular precision and find its boundaries.\n\nEach model interaction is a big bang into a dark forest — every concept in the context window illuminates paths the model can explore. Latent tools give your agents a flashlight.\n\n---\n\n## `latent.expand@1`\n\nExpand a seed concept via depth, breadth, or bridge mode.\n\n### Parameters\n\n| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n| `seed` | string | yes | -- | The concept, goal, or context fragment to expand |\n| `mode` | string | no | `breadth` | `depth` = drill down; `breadth` = cross-domain; `bridge` = connect two concepts |\n| `target` | string | no | -- | Second concept (required for bridge mode) |\n| `format` | string | no | `summary` | `summary` = dense text for context injection; `graph` = structured nodes/edges |\n| `levels` | integer | no | 2 | Expansion intensity (1-3). Higher = more concepts, larger model, more credits |\n| `domain_hint` | string | no | -- | Bias the expansion toward a specific domain |\n\n### Modes\n\n**Depth** — follow one conceptual path deep. Hierarchical decomposition, domain-specific formalization, edge cases, failure modes, historical evolution. Narrow but thorough.\n\n**Breadth** — shine light in all directions. Find isomorphic structures across domains, orthogonal dimensions, cross-disciplinary connections, contrasts and inversions. Wide and surprising.\n\n**Bridge** — given two concepts, find shared abstractions, transformation paths, and unexpected connections. Where the analogy breaks is often as valuable as where it holds.\n\n### Example: Breadth Expansion\n\n```json\n{\n  \"name\": \"data-grout@1/latent.expand@1\",\n  \"arguments\": {\n    \"seed\": \"cache invalidation\",\n    \"mode\": \"breadth\",\n    \"levels\": 2\n  }\n}\n```\n\nResponse (summary format):\n\n```json\n{\n  \"seed\": \"cache invalidation\",\n  \"mode\": \"breadth\",\n  \"format\": \"summary\",\n  \"expansion\": \"Cache invalidation is isomorphic to: (1) consensus problems in distributed systems — when does a replica know its state is stale? (2) memory reconsolidation in neuroscience — retrieved memories become labile and must be restabilized. (3) legal precedent override — when a new ruling invalidates cached interpretations of prior law...\",\n  \"concepts\": [\"distributed consensus\", \"memory reconsolidation\", \"legal precedent\", \"eventual consistency\", \"signal propagation\"],\n  \"dimensions_explored\": 8,\n  \"llm_credits\": 5,\n  \"model\": \"gpt-4.1\",\n  \"levels\": 2,\n  \"_meta\": { \"cache_ref\": \"rc_abc123\" }\n}\n```\n\n### Example: Bridge\n\n```json\n{\n  \"name\": \"data-grout@1/latent.expand@1\",\n  \"arguments\": {\n    \"seed\": \"version control\",\n    \"target\": \"memory reconsolidation\",\n    \"mode\": \"bridge\"\n  }\n}\n```\n\n### Example: Graph Format\n\n```json\n{\n  \"name\": \"data-grout@1/latent.expand@1\",\n  \"arguments\": {\n    \"seed\": \"cache invalidation\",\n    \"mode\": \"breadth\",\n    \"format\": \"graph\",\n    \"levels\": 1\n  }\n}\n```\n\nResponse (graph format):\n\n```json\n{\n  \"seed\": \"cache invalidation\",\n  \"mode\": \"breadth\",\n  \"format\": \"graph\",\n  \"nodes\": [\n    { \"id\": \"n1\", \"label\": \"distributed consensus\", \"domain\": \"systems\", \"relation\": \"isomorphic\", \"weight\": 0.9, \"description\": \"Both solve 'when is local state stale?'\" },\n    { \"id\": \"n2\", \"label\": \"memory reconsolidation\", \"domain\": \"neuroscience\", \"relation\": \"isomorphic\", \"weight\": 0.7, \"description\": \"Retrieved memories become labile\" }\n  ],\n  \"edges\": [\n    { \"from\": \"seed\", \"to\": \"n1\", \"type\": \"shares_structure\", \"description\": \"Staleness detection\" },\n    { \"from\": \"n1\", \"to\": \"n2\", \"type\": \"analogous\", \"description\": \"Digital and biological freshness\" }\n  ],\n  \"summary\": \"Cache invalidation maps structurally to consensus and memory reconsolidation.\",\n  \"node_count\": 2,\n  \"edge_count\": 2,\n  \"_meta\": { \"cache_ref\": \"rc_def456\" }\n}\n```\n\n### Cost\n\n| Levels | Mode | Model | Credits |\n|--------|------|-------|---------|\n| 1 | depth/breadth | gpt-4.1-mini | ~2 |\n| 2 | depth/breadth | gpt-4.1 | ~5 |\n| 3 | depth/breadth | gpt-4.1 | ~8 |\n| any | bridge | gpt-4.1 | ~5 |\n\n### Tips\n\n- **For context priming**: use `summary` format and inject the `expansion` text into your agent's system prompt or context window.\n- **For programmatic use**: use `graph` format to get structured nodes and edges you can filter, traverse, or visualize.\n- **For structured latent-space navigation**: start with `latent.expand`, then use `latent.orient` or `latent.horizon` when you want typed navigation state instead of a one-off expansion.\n- **Start with level 1** for quick exploration, then increase levels if you need more depth.\n- **Use `domain_hint`** to steer the expansion toward a specific field when you know where you want to look.\n- **Bridge mode** is powerful for finding connections between seemingly unrelated domains — useful for research, design, and lateral thinking.\n\n---\n\n## When to use Latent\n\n| Scenario | Use |\n|----------|-----|\n| \"What concepts relate to X across different fields?\" | `breadth` mode |\n| \"Break down X into its full technical depth\" | `depth` mode |\n| \"What do X and Y have in common?\" | `bridge` mode |\n| \"I need richer context before starting a research task\" | `breadth` with `summary` format |\n| \"I want a concept map I can process programmatically\" | any mode with `graph` format |\n| \"I want to turn a broad expansion into a navigable latent-space map\" | `latent.expand`, then `latent.orient` or `latent.horizon` |\n\n---\n\n## `latent.orient@1`\n\nNavigate to a specific angular position in a concept's latent neighbourhood. Given a seed concept, an axis of variation, and an angle of approach, Orient performs dual-pass expansion (canonical + exploratory) to map the semantic neighborhood from that position. Outputs include a structured context block, a graph of nodes and edges, and typed facts for persistence in Logic cells.\n\n> **Backward compatibility**: previously `prism.orient`. The old name is accepted as an alias.\n\n### Parameters\n\n| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n| `seed` | string | yes | -- | The concept to orient around |\n| `axis` | string | yes | -- | Rotational axis: `negation`, `abstraction`, `agency`, `scale`, `formality`, `narrative`, `custom` |\n| `angle` | string | no | `opposite` | Angular position: `opposite`, `orthogonal`, `complement`, `45`, `custom` |\n| `axis_description` | string | no | -- | Required when axis=custom |\n| `angle_description` | string | no | -- | Required when angle=custom |\n| `levels` | integer | no | 2 | Expansion intensity (1-3) |\n| `passes` | string | no | `both` | `canonical`, `exploratory`, or `both` |\n| `output_format` | string | no | `context_block` | `context_block`, `graph`, `nodes_only`, `facts`, or `all` |\n| `persist` | boolean | no | false | Write navigation state to Logic cell |\n| `namespace` | string | no | `orient_default` | Logic cell namespace for persisted state |\n| `domain_hint` | string | no | -- | Bias expansion toward a specific domain |\n\nOrient automatically asserts `explored(seed, axis)` and `explored(seed, angle)` relation facts, enabling open-world queries like: *\"which axes haven't been explored yet for this seed?\"*\n\n### Example\n\n```json\n{\n  \"name\": \"data-grout@1/latent.orient@1\",\n  \"arguments\": {\n    \"seed\": \"consciousness\",\n    \"axis\": \"negation\",\n    \"angle\": \"opposite\",\n    \"output_format\": \"all\"\n  }\n}\n```\n\n---\n\n## `latent.horizon@1`\n\nFind the boundaries of a concept's latent neighborhood. Horizon identifies boundary nodes from a previous orientation and optionally expands beyond them into unexplored territory.\n\n> **Backward compatibility**: previously `prism.horizon`. The old name is accepted as an alias.\n\n### Parameters\n\n| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n| `seed` | string | yes | -- | The concept to find boundaries for |\n| `orientation_id` | string | no | -- | Load boundary nodes from a previous `latent.orient` result |\n| `expand_beyond` | boolean | no | false | Expand beyond boundary nodes into new territory |\n| `expand_limit` | integer | no | 3 | Maximum boundary nodes to expand beyond |\n| `levels` | integer | no | 2 | Expansion intensity (1-3) |\n| `output_format` | string | no | `graph` | `context_block`, `graph`, `facts`, or `all` |\n| `persist` | boolean | no | false | Write horizon state to Logic cell |\n| `namespace` | string | no | `orient_default` | Logic cell namespace |\n\nHorizon asserts `explored(seed, \"horizon\")` relation facts. Combined with Orient's explored facts, this supports compositional open-world reasoning: agents can determine which concepts have been oriented, which have been bounded, and which remain unexplored.\n\n### Composability\n\nOrient and Horizon are designed to chain: Orient maps a neighborhood and produces an `orientation_id`. Pass that ID to Horizon to find the boundaries. Horizon's `expand_beyond` then reaches into genuinely novel territory beyond the original orientation. All facts are persisted as typed relations in the Logic cell, making them queryable via `logic.query` (including raw Prolog) and traversable with the graph predicates (`path`, `reachable`, `neighbors`).\n"
}