CogForge

Beta

Java agent framework for tool-using AI

A purpose-built Java SDK for building autonomous, tool-using AI agents with ReAct execution loops, MCP-compatible tools, and observable event streams.

CogForge brings first-class agent capabilities to the Spring ecosystem. Instead of relying on Python-centric frameworks, it uses Java 21 features — sealed interfaces, records, and reactive Mono/Flux chains — to build agents that are type-safe, observable, and production-ready.

The core abstraction is the ReAct loop: an agent reasons about a goal, selects tools, executes them, observes results, and iterates. Every action emits typed AgentEvent objects via a Flux stream, making the entire execution auditable. Tools follow the MCP standard with JSON Schema definitions and safety annotations.

Integrates with Cog-Bot's cognitive memory for cross-session learning. Agents can store reflections and query accumulated heuristics across runs.

Key Features

  • ReAct (Reason + Act + Observe) execution loop with configurable constraints
  • MCP-compatible tool protocol interoperable with Claude, Spring AI, and other clients
  • Observable event stream: every tool call, thought, and reflection emitted as typed events
  • Sealed interface type system for Agent, AgentEvent, and Tool abstractions
  • MockChatModel test harness for deterministic testing without LLM calls
  • Spring Boot auto-configuration with @ConfigurationProperties
  • Built-in sandboxed tools: shell execution, file read, HTTP request

Built With

Java 21Spring Boot 3.4Spring AIMCPWebFluxJUnit 5

Interested in this solution?

I can help you deploy, customize, or build something similar for your specific needs.