← All tools

Logic Tools

Persistent symbolic memory for AI agents. Store facts, query knowledge, define constraints, and reason over structured data — all with sub-millisecond latency, no LLM required. Facts persist across sessions, are shared across all agents on the same server, and are encrypted at rest. Use custom namespaces for completely isolated logic cells.

Why this matters

LLMs lose context between sessions. Logic tools give each user a persistent fact space backed by a symbolic reasoning engine. Facts stored today are queryable tomorrow — no re-learning, no context stuffing. Multiple agents on the same server share the same fact space, so knowledge accumulated by one agent is immediately available to all others. All Prolog facts are encrypted at rest using AES-256-GCM.

Capabilities

  • logic.remember — Store facts as natural language or structured key-value triples
  • logic.assert — Store typed facts directly — zero LLM cost, full Prolog participation
  • logic.query — Natural language, structured patterns, or raw Prolog goals — three query modes for any level of precision
  • logic.constrain — Define rules that actively affect future queries and block or modify workflow execution
  • logic.forget — Retract facts by handle or pattern when information changes
  • logic.reflect — Audit what the system knows about an entity or browse the full fact space
  • logic.hydrate — Goal-driven context assembly: decomposes a goal, queries relevant facts, and returns budget-constrained context
  • Graph traversal — Built-in path, reachable, and neighbors predicates for navigating relation edges at engine speed

Constraints as guardrails

Constraints aren't just metadata — they actively influence execution. Define a constraint like "never process transactions above $10,000 without approval" and it will be checked by flow.into before executing steps that match. This gives you declarative business rules that apply across all workflows without modifying each one individually.

Namespace isolation

Every logic tool accepts an optional namespace parameter. Each namespace gets its own logic cell with double isolation: the application routes each namespace to a dedicated cell, and the underlying Prolog engine independently scopes all assertions and queries to that namespace's key — so even if one layer had a bug, the other would still prevent cross-namespace access. Facts, constraints, and queries in one namespace are invisible to another. The default namespace is shared across all tools on the server, but you can create as many custom namespaces as you need: one per project, per customer, per workflow, or per concern. Use logic.worlds to list all your active namespaces with fact counts and last activity.

Example: store and query

// Store a fact
{ "name": "data-grout@1/logic.remember@1",
  "arguments": {
    "statement": "Acme Corp billing contact is jane@acme.com",
    "tag": "contacts"
  }
}

// Query it later — even in a different session
{ "name": "data-grout@1/logic.query@1",
  "arguments": {
    "question": "Who is the billing contact for Acme?"
  }
}

Composes with

Prism orient and horizon persist navigation facts directly into Logic cells — query and traverse latent space graphs with raw Prolog or graph predicates. Use constraints to enforce business rules in Flow workflows. Query facts to make routing decisions in flow.route. Track suspicion across turns with Warden sessions. Use Data tools to filter or sort query results.