Skip to content
Conduit

skill

prolog-reasoning

Neuro-Symbolic memory for LLM agents: LEGACY repo - new work at prethinker

dr3d/prolog-reasoningcommunitylistedunreviewed

Set up

Skills are installed by placing their folder where your agent loads skills.

The download comes from github.com/dr3d/prolog-reasoning itself, not from our server, so what you get is exactly what its author published.

Install instructions come from the README

Skills do not use an MCP config. Follow the steps in the README below.

README

synced Oct 22, 2026

Prolog Reasoning

A Pre-Thinker for Neuro-Symbolic Knowledge Capture

Memories are timestamped. Facts are not. Hallucinations begin when facts collapse into memories.

Prolog Reasoning is a local-first research and engineering repo focused on the write path of agent memory: how natural language should (or should not) become symbolic state.

Instead of treating memory as "retrieve more text," this project instruments the full language-to-state path: classification, normalization, validation, deterministic execution, and auditable explanation.

Tests Python License

Why This Matters (NSAI)

Many agent stacks emphasize query quality. This repo emphasizes a harder failure point: language -> state conversion.

  • Schema drift silently corrupts memory (mother/2 vs parent/2).
  • Uncertain language gets over-committed as hard fact.
  • Runtime tool loops mutate state faster than teams can audit.

This project treats those as first-class engineering problems and builds explicit safety contracts around them.

Core Thesis

The hardest problem is no longer query execution. The hardest problem is deciding what language should become symbolic state.

Architecture At A Glance

incoming language -> pre-thinker proposal -> deterministic policy gates -> symbolic KB -> auditable derivations

Latest Pre-Thinker Drop (April 2026)

Run the edge battery:

python scripts/run_prethinker_edge_matrix.py --dataset data/fact_extraction/prethinker_edge_cases_v1.json

Component roles:

  • Pre-thinker (emerging): classifies utterances, proposes symbolic candidates, and flags uncertainty.
  • Deterministic policy layer: decides what can be asserted, deferred, clarified, rejected, or retracted.
  • Symbolic core: executes Prolog and propagation logic deterministically.
  • Explanation layer: surfaces proof-oriented failure and success reasoning for auditability.

What Is Real Today

Implemented and runnable now:

Explicit Boundaries (Important)

Current runtime is intentionally conservative:

  • classify_statement returns routing + proposal_check; it is not a durable write operation.
  • MCP runtime mutation tools (assert_fact, bulk_assert_facts, retract_fact, reset_kb) are process-local simulation state.
  • Runtime state resets to prolog/core.pl; durable journaled memory write-path is still an active build track.
  • Pre-thinker LoRA and full write journaling are design/research tracks, not default runtime behavior today.

If you need production-persistent memory right now, treat this as a research lab and integration substrate, not a finished memory product.

Quick Start

git clone <repo>
cd prolog-reasoning
pip install -r requirements.txt

# Baseline verification
python -m pytest tests -q
python scripts/check_docs_consistency.py

# Windows/PowerShell onboarding smoke
./scripts/pr1_smoke.ps1

Evaluate The Project Like A Research System

Start with the docs that define the technical spine:

  1. docs/pre-thinker-control-plane.md
  2. docs/fact-intake-pipeline.md
  3. docs/research/fact-ingestion-benchmark-matrix-spec.md
  4. docs/research/model-scenario-matrix.md
  5. docs/research/scenarios/README.md

Then inspect concrete run artifacts:

Historical archive (open only when you explicitly need old runs):

Run a scenario capture (LM Studio required for live calls):

python scripts/run_conversaton.py \
  --conversation-file docs/research/scenarios/scenario-2.md \
  --continue-on-error

Dry-run parser check (no LM calls):

python scripts/run_conversaton.py \
  --conversation-file docs/research/scenarios/scenario-2.md \
  --dry-run

Choose Your Path

Use It

Understand It

Build On It

Repo Map

src/
  engine/        Prolog interpreter and propagation engine
  ir/            Structured intermediate representation
  compiler/      IR to Prolog conversion
  parser/        Natural-language grounding and classification
  explain/       Proof traces and failure translation
  validator/     Semantic validation
  mcp_server.py  MCP integration

scripts/         Demos, capture runners, and research utilities
tests/           Unit and integration tests
data/            Benchmarks and evaluation artifacts
docs/            Design docs, guides, scenarios, and captured runs
prolog/          Knowledge-base files
training/        Beginner-facing learning materials
prototypes/      Experimental lanes and promotion tracks
mvp/             Experimental constraint graphics prototype

Local LLM Integration

To expose MCP server via stdio:

python src/mcp_server.py --stdio

LM Studio typically launches this from mcp.json. Replace placeholders with your local values:

{
  "mcpServers": {
    "prolog-reasoning": {
      "command": "<PYTHON_EXE>",
      "args": [
        "<REPO_ROOT>\\src\\mcp_server.py",
        "--stdio",
        "--kb-path",
        "<REPO_ROOT>\\prolog\\core.pl"
      ],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

Relevant references:

Constraint Propagation

Deterministic propagation supports known-state and domain-narrowing workflows:

python src/engine/runner.py --propagate --problem-json data/propagation_example.json

Experimental Graphics Editor

The constraint graphics editor in mvp is exploratory and not the project spine.

Current Status

Current center of gravity:

  • deterministic symbolic core is working
  • write-path research is active and instrumented
  • pre-thinker is the emerging control layer
  • durable memory revision/journaling is the next major engineering frontier

For current state details and sequencing, see status.md, roadmap.md, and sessions.md.

License

MIT License. See LICENSE.

↑↓ navigate openesc close