Using and validating reasoning results

Use explicit programs, bounded evaluation and small known inputs before applying reasoning to application data. Standalone evaluation, graph projection and temporal claim extraction have distinct source and persistence contracts.

Install and isolate

Use Python 3.10–3.13 and a fresh environment. The standalone core needs no database backend, solver, JVM, Arrow or Polars:

1python -m venv .venv-reasoning
2. .venv-reasoning/bin/activate
3python -m pip install gestaltdb

For explicit persisted graph/claim workflows, select a backend, for example python -m pip install 'gestaltdb[lmdb]'. JSON and Pickle are built in; optional binary serializers and backends are independent extras. Do not install every benchmark client just to use the reasoner. See Installation.

First standalone closure

Standalone example. Install with python -m pip install "gestaltdb".

 1from gestaltdb.reasoning import (
 2    GenericEngine, GenericProgram, GenericRule, TypedAtom, TypedFact,
 3)
 4from gestaltdb.reasoning.model import ReasoningLimits, Variable
 5
 6x, y = Variable("x"), Variable("y")
 7program = GenericProgram([
 8    GenericRule("member-is-person", [TypedAtom("memberOf", [x, y])], [],
 9                TypedAtom("person", [x])),
10])
11result = GenericEngine().evaluate(
12    program, [TypedFact("memberOf", ["alice", "research"])],
13    limits=ReasoningLimits(),
14)
15assert TypedFact("person", ["alice"]) in result.facts

The result is a finite closure, not a write to a database. In-memory facts, compiled ontologies, graph projections and temporal claim adapters are distinct interfaces. Select the adapter explicitly rather than expecting Cypher to materialize inferred data automatically.

Supported paths and deliberate boundaries

Compatibility and safe testing

Keep a backup and test on a disposable copy before upgrading a valuable database. Do not assume downgrade compatibility after new writes, or share an open directory between different GestaltDB versions. Reopen requires the configured backend and serializer; see Compatibility, Migration, and Recovery for lifecycle and recovery guidance.

No implicit physical node merge, backend fallback or history migration is part of enabling reasoning. Honor backend snapshot/publication capabilities; in particular LevelDB does not expose a unified mutable graph snapshot. Keep experimental outputs and managed inferred worlds separate from base claims. Validate provenance and scopes when reusing plans, caches or sessions.

What to test and report

Start with installation and a small known closure, then test your representative rules with duplicate assertions, corrections, final-support retractions and rule changes. Compare incremental/session results with a fresh evaluation. For temporal workflows, compare point answers at boundaries against range answers, including gaps and overlapping evidence.

Report Python/GestaltDB/backend/serializer versions, selected profile/executor, limits, a small reproducible rule/input set, expected versus actual answers, and whether a fresh rebuild agrees. Include stage timings and graph shape for performance reports, not unsupported universal speedup conclusions. Remove credentials and private graph data from reports. Report reproducible problems through the repository’s GitHub issues.