Skip to content

v0.1.0 - Initial public release

Choose a tag to compare

@rikarazome rikarazome released this 14 Apr 08:44

Initial public release of prolog-reasoner — SWI-Prolog as a "logic calculator" for LLMs, available as both an MCP server and a Python library.

Added

  • MCP server exposing a single tool, execute_prolog, for use by connected LLMs (no API key required on the server side)
  • Python library with full NL→Prolog pipeline: PrologReasoner.translate() + PrologReasoner.execute() with self-correction loop (requires OpenAI or Anthropic API key)
  • SWI-Prolog subprocess execution backend with CLP(FD) support, shared by both MCP and library
  • OpenAI and Anthropic LLM provider support via optional dependencies (library only)
  • Docker environment (Python 3.12 + SWI-Prolog 9.x)
  • Benchmark suite: 10 logic problems comparing LLM-only vs LLM+Prolog reasoning
  • Configuration via environment variables (PROLOG_REASONER_*)
  • Lazy initialization in server.py so from prolog_reasoner.server import mcp succeeds even without SWI-Prolog at import time
  • Comprehensive test suite (81 tests)

Reliability

  • Guaranteed tempfile cleanup via try/finally in PrologExecutor.execute() and validate_syntax() — no leak on unexpected exceptions

Security

  • API key redaction in all log output
  • Input validation via Pydantic models
  • Execution timeout protection against infinite loops

Installation

# MCP server only (no LLM dependencies)
pip install prolog-reasoner

# Library with OpenAI
pip install prolog-reasoner[openai]

# Library with Anthropic
pip install prolog-reasoner[anthropic]

See README.md for full setup instructions.