Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FastAIReasoner 0.1.0 β€” Multi-Step Reasoning & Cognitive Planning Engine for Java

Status License: MIT Java Platform JitPack


⚑ 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

import fastai.AI;
import fastai.FastAI;
import fastaireasoner.FastAIReasoner;
import fastaireasoner.ReasoningResult;

public class Demo {
    public static void main(String[] args) {
        AI brain = FastAI.connect("ollama:qwen2.5-coder:7b");

        // 1. Instantiate reasoning engine with Tree-of-Thoughts (ToT) strategy
        FastAIReasoner reasoner = FastAIReasoner.treeOfThoughts(brain, 3 /* branches */, 2 /* depth */);

        // 2. Perform deep reasoning on complex architectural problem
        ReasoningResult result = 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 / Factory Return Type Description
FastAIReasoner.chainOfThought(AI) FastAIReasoner Sequential reasoning pipeline with step validation.
FastAIReasoner.treeOfThoughts(AI, int, int) FastAIReasoner Branching tree search exploring multiple candidate thoughts.
FastAIReasoner.mcts(AI, int) FastAIReasoner Heuristic Monte Carlo search for strategic planning.
reasoner.reason(String goal) ReasoningResult Evaluates 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 Ecosystem β€” Making 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