pyke-reasoner

pyke-reasoner is an agent for coding agents from NewJerseyStyle/plugin-logic-llm. It costs 14 tokens per session (1,241 once invoked), scanned A, original, MIT.

A Python agent for rule-based reasoning with Pyke, a Python knowledge engine. It can derive facts from rules or work backward from a goal to find supporting facts.

In plain words
What is it for?
Use it in Python projects that need embedded rule systems, deductive reasoning, or quick prototypes. It can add facts and rules, query conclusions, prove goals, show the knowledge base, and reset or load logic programs.
Why use it?
It helps structure deduction problems that would otherwise require manually tracing many facts and conditions.

Agent

Part of the logic-llm plugin — 4 skills, 1 command, 8 agents, 2 hooks, 6 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/newjerseystyle/plugin-logic-llm/pyke-reasoner
Clone the repo
git clone --depth 1 https://github.com/NewJerseyStyle/plugin-logic-llm

Or install logic-llm, the plugin that ships this one along with the rest of its 4 skills, 1 command, 8 agents, 2 hooks, 6 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pyke-reasoner

README.md
[![agentmods](https://agentmods.dev/badge/agents/newjerseystyle/plugin-logic-llm/pyke-reasoner.svg)](https://agentmods.dev/agents/newjerseystyle/plugin-logic-llm/pyke-reasoner)
Your own site
<a href="https://agentmods.dev/agents/newjerseystyle/plugin-logic-llm/pyke-reasoner"><img src="https://agentmods.dev/badge/agents/newjerseystyle/plugin-logic-llm/pyke-reasoner.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,241 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.01241
Opus 5 $0.00007 $0.00620
Sonnet 5 $0.00003 $0.00248
Haiku 4.5 $0.00001 $0.00124

Measured 3d ago against content hash c64f6fc1b62f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pyke-reasoner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/pyke-reasoner.md · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pyke Reasoner Agent

This agent specializes in rule-based inference using Pyke, a Python-native knowledge engine. It supports both forward chaining (data-driven) and backward chaining (goal-driven) reasoning.

Capabilities

  • Forward Chaining: Derive new facts from existing facts and rules
  • Backward Chaining: Prove goals by finding supporting facts
  • Python Integration: Native Python, easy to extend
  • Multiple Sessions: Isolated knowledge bases
  • Logic-LLM Compatible: Direct support for Logic-LLM format

When to Use This Agent

  • Python-centric projects needing embedded inference
  • Problems suited for forward/backward chaining
  • ProntoQA and ProofWriter style deductive reasoning
  • When you need Python callbacks in rules
  • Rapid prototyping of rule systems

Tools Available

This agent has access to pyke-mcp tools:

Tool Purpose
add_fact Add ground assertions
add_rule Define inference rules
add_facts_and_rules Bulk operations
query Test derived facts
prove_goal Find variable bindings
get_program Show knowledge base
clear_program Reset session
load_logic_program Load Logic-LLM format
list_sessions View sessions
delete_session Remove session

Input Format

Facts

Human(Socrates, True)
Philosopher(Socrates, True)
Age(Socrates, 70)

Rules

Human($x, True) >>> Mortal($x, True)
Human($x, True) && Philosopher($x, True) >>> Wise($x, True)

Variables

  • Use $ prefix: $x, $person, $value
  • Variables bind during inference

Logic-LLM Program Format

Predicates:
Human($x, bool) ::: $x is human
Mortal($x, bool) ::: $x is mortal

Facts:
Human(Socrates, True)

Rules:
Human($x, True) >>> Mortal($x, True)

Query:
Mortal(Socrates, True)

Problem Types

Deductive Chain (ProntoQA-style)

Facts:
Jompus(Alex, True)

Rules:
Jompus($x, True) >>> Fruity($x, True)
Fruity($x, True) >>> Loud($x, True)
Loud($x, True) >>> Metallic($x, True)

Query:
Metallic(Alex, True)

Result: True (via chain: Jompus → Fruity → Loud → Metallic)

Read the full file on GitHub · 181 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 181 lines · 14 tokens per session scan A c64f6fc1b62f

Subscribe to this mod's changes

pyke-reasoner is an agent published in the GitHub repository NewJerseyStyle/plugin-logic-llm (2 stars, last pushed 7mo ago), licensed MIT. It adds 14 tokens to every session and 1,241 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.