Skip to content

Repository files navigation

FastAIReasoner 0.1.0 — Multi-Step Reasoning & Cognitive Planning Engine for Java

StatusLicense: MITJavaPlatformJitPack


⚡ Multi-step reasoning, Chain-of-Thought (CoT), Tree-of-Thoughts (ToT), and heuristic path evaluation — Deep cognitive planning engine for the FastJava AI ecosystem.

FastAIReasoner provides structured cognitive search and reasoning capabilities for Java AI agents. It evaluates solution paths, explores branch states, and performs self-consistency verification before actions are executed in FastAIAgent or FastAIRuntime.

FastAIReasoner Cognitive Strategies


Quick Start — Example

importfastai.AI;
importfastai.FastAI;
importfastaireasoner.FastAIReasoner;
importfastaireasoner.ReasoningResult;
publicclassDemo {
publicstaticvoidmain(String[] args) {
AIbrain = FastAI.connect("ollama:qwen2.5-coder:7b");
// 1. Instantiate reasoning engine with Tree-of-Thoughts (ToT) strategyFastAIReasonerreasoner = FastAIReasoner.treeOfThoughts(brain, 3/* branches */, 2/* depth */);
// 2. Perform deep reasoning on complex architectural problemReasoningResultresult = reasoner.reason("Design a lock-free event dispatcher in Java");
System.out.println("Best Plan: " + result.bestPath());
System.out.println("Confidence: " + result.confidenceScore());
}
}

Table of Contents


Why FastAIReasoner?

Standard LLM prompting produces linear, error-prone responses on multi-step logic and coding tasks. FastAIReasoner delivers:

  • State-Space Exploration — Explores alternative reasoning branches before committing to an action.
  • Self-Consistency Scoring — Samples multiple rationale paths and ranks the most reliable outcome.
  • Agent Integration — Directly plugs into FastAIAgent's planning and reflection phases.
  • Zero Framework Overhead — Pure Java 17+ with sub-millisecond graph evaluation.

Key Features

  • 🌲 Tree-of-Thoughts (ToT) — Explores tree-structured rationale paths with branch pruning.
  • 🔗 Chain-of-Thought (CoT) — Step-by-step sequential deduction with explicit verification gates.
  • 🎯 Monte Carlo Tree Search (MCTS) — Rollout simulations and heuristic value scoring for complex goal decomposition.
  • ⚡ Fast Reflection & Self-Healing — Evaluates execution anomalies and generates counter-plans.

Architecture Overview

FastAIReasoner (The Reasoner & Planning Engine)
Evaluates cognitive hypotheses, scores branches, and outputs optimal execution plans.

FastAIAgent (The Mind)
Consumes reasoning plans and orchestrates the ReAct loop (Observe → Plan → Act → Reflect → Memory).

FastAIRuntime (The Body)
Executes the deterministic tool actions selected by the reasoner.


API Quick Reference

Method / FactoryReturn TypeDescription
FastAIReasoner.chainOfThought(AI)FastAIReasonerSequential reasoning pipeline with step validation.
FastAIReasoner.treeOfThoughts(AI, int, int)FastAIReasonerBranching tree search exploring multiple candidate thoughts.
FastAIReasoner.mcts(AI, int)FastAIReasonerHeuristic Monte Carlo search for strategic planning.
reasoner.reason(String goal)ReasoningResultEvaluates the goal and returns the highest-scoring plan path.

Installation

Option 1: Maven (Recommended)

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastAIReasoner</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastai</artifactId>
<version>0.1.7</version>
</dependency>
</dependencies>

License

MIT License — See LICENSE file for details.


Related Projects

  • FastAI — Unified AI client interface for Java
  • FastAIAgent — Autonomous agent loop, intent-graphs, and tool execution
  • FastAIBot — Zero-bloat bot harnesses and persona runtime
  • FastAIGraph — In-memory knowledge graph and multi-hop relationship engine
  • FastAIHybrid — Dense-sparse hybrid search fusion (BM25 + Vectors)
  • FastAIMCP — Model Context Protocol (MCP) server & tool integration
  • FastAIMemory — Conversation history, sliding windows, and rolling summaries
  • FastAIModel — Native local inference runtime (GGUF/ONNX)
  • FastAIRag — Ultra-fast document chunking and vector retrieval
  • FastAIReasoner — Deterministic planning, chain-of-thought, and self-correction
  • FastAIRerank — Cross-encoder relevance filtering and Top-N prompt pruner
  • FastAIRuntime — Sandboxed process runner and tool-calling execution pipeline
  • FastAIVectorDB — High-throughput SIMD/AVX2 vector database
  • FastCore — Unified JNI loader and platform abstraction

Part of the FastJava EcosystemMaking the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋

About

🧠 Multi-step reasoning, Chain-of-Thought (CoT), Tree-of-Thoughts (ToT), and heuristic planning engine for Java.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages