v0.12.0

The Java framework for AI agents.

Open-source, annotation-driven, on Maven Central. Twelve modules, 13 LLM providers, 62 POJO toolkits (206 @Tool methods), multi-agent coordination, MCP, and native Anthropic prompt caching.

Add to your pom.xml
io.github.tansuasici:tnsai-bom:0.12.0

Or paste the full BOM block — see Install

12
moduleslockstep
98
annotationsdeclarative
206
@Tool methods62 POJO toolkits
9 071
testsJUnit 5
13
LLM providerssingle SPI
Providers

13 LLMs · one SPI

Single LLMClient interface across providers.

AnthropicOpenAIGoogle GeminiMistralAWS BedrockAzure OpenAICohereGroqOpenRouterOllamaHugging FaceMiniMaxZhipu AI
Architecture

12 modules · one version

Lockstep release. Pull tnsai-bom, depend on what you use, no per-module versions.

01 · LayerFoundation
tnsai-coretnsai-llm
02 · LayerCognitive
tnsai-intelligencetnsai-coordination
03 · LayerProduction
tnsai-qualitytnsai-evaluation
04 · LayerIntegrations
tnsai-mcptnsai-toolstnsai-channels
05 · LayerAggregation
tnsai-integrationtnsai-servertnsai-bom

Apache 2.0 · Maven Central · BOM-pinned · JDK 21+. Each module ships as io.github.tansuasici:tnsai-*:0.12.0.

Quickstart

Three steps

1

Add the BOM

One Maven import pins every tnsai-* module to the same version. Depend on what you use without specifying versions twice.

pom.xmlXML
<dependencyManagement>
<dependency>
<groupId>io.github.tansuasici</groupId>
<artifactId>tnsai-bom</artifactId>
<version>0.12.0</version>
<type>pom</type><scope>import</scope>
</dependency>
</dependencyManagement>
2

Define a role

A role extends Role and declares its identity, duties, and actions. @ActionSpec methods become tools the agent can call; @Param maps tool arguments to method parameters.

ResearcherRole.javaJava
public class ResearcherRole extends Role {
 
@Override public RoleIdentity getIdentity() {
return new RoleIdentity("researcher",
"Find academic papers", "research");
}
 
@ActionSpec(type = ActionType.LOCAL)
public List<Paper> search(@Param(name="q") String q) {
return arxiv.find(q);
}
}
3

Build, start, chat

AgentBuilder runs four pre-flight validators at build() time — missing role, missing LLM, capability mismatches (AGENT-V001…V003) — so misconfigurations throw AgentValidationException before the first message goes out.

Main.javaJava
Agent agent = AgentBuilder.create()
.role(new ResearcherRole())
.llm(AnthropicClient.builder()
.model("claude-sonnet-4")
.withPromptCaching() // −75% input cost
.build())
.build(); // throws on misconfig
 
agent.start();
String reply = agent.chat("Find papers on RAG eval.");

Need more depth? Installation guide · Agent concepts · Quickstart

BuildPASS
Tests9 071
Version0.12.0
Released2026-04-29
StatusGREEN