TnsAI

Installation

Add TnsAI to your project. The recommended path is via the BOM — one version number covers every module.

All tnsai-* artifacts are published to Maven Central under the io.github.tansuasici group. Browse them at central.sonatype.com/namespace/io.github.tansuasici.

Prerequisites

  • Java 21+
  • Maven 3.9+ or Gradle 8+

Import the BOM once in <dependencyManagement>, then list the modules you need in <dependencies> without any <version> tag:

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

<dependencies>
    <dependency>
        <groupId>io.github.tansuasici</groupId>
        <artifactId>tnsai-core</artifactId>
    </dependency>
    <dependency>
        <groupId>io.github.tansuasici</groupId>
        <artifactId>tnsai-llm</artifactId>
    </dependency>
    <!-- pick any other tnsai-* module — versions come from the BOM -->
</dependencies>

To upgrade: change the single <version> on tnsai-bom. Every tnsai-* module moves together.

Gradle

dependencies {
    implementation(platform("io.github.tansuasici:tnsai-bom:0.12.0"))
    implementation("io.github.tansuasici:tnsai-core")
    implementation("io.github.tansuasici:tnsai-llm")
    // pick any other tnsai-* module — versions come from the BOM
}

Available modules

ModuleWhat it provides
tnsai-coreAgent lifecycle, action routing, tools, capabilities, streaming
tnsai-llmLLM providers — Anthropic, OpenAI, Gemini, NVIDIA, Mistral, Groq, Cohere, OpenRouter, Hugging Face, xAI, DeepSeek, Perplexity, Together, Fireworks, Cerebras, Replicate, DeepInfra, Databricks, watsonx, MiniMax, Zhipu, Azure, Ollama
tnsai-intelligenceRAG, knowledge bases, planning, reasoning, context management
tnsai-coordinationMulti-agent groups, topologies, negotiation, workflows
tnsai-qualityOpenTelemetry, Prometheus, prompt injection detection, sandboxing
tnsai-evaluationG-Eval, release gates, regression detection
tnsai-mcpModel Context Protocol — client, server, stdio/SSE/streamable-HTTP transports
tnsai-tools62 POJO toolkits (~206 @Tool methods) across web, file, DB, code, media, fintech, …
tnsai-channelsTelegram / CLI / Email / Slack / Discord / WhatsApp channel adapters via SPI
tnsai-integrationExternal framework bridges and integration tests
tnsai-serverHTTP/WebSocket agent server (Javalin-based)

Detailed per-module guidance → Module Overview.

If for some reason you want to pin module versions individually:

<dependency>
    <groupId>io.github.tansuasici</groupId>
    <artifactId>tnsai-core</artifactId>
    <version>0.12.0</version>
</dependency>

This works but you're now responsible for keeping every tnsai-* dep on the same version. BOM mismatch is the #1 source of runtime surprises — stick with the BOM unless you have a specific reason.

Logging — pick an SLF4J backend

TnsAI uses SLF4J for all internal logging. SLF4J is a facade — TnsAI itself only depends on slf4j-api, the interface layer. You must add a logging implementation to your own project, otherwise SLF4J prints

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation.

at startup and you'll see no log output at all.

This is the standard Java pattern (Spring, Jackson, Apache HTTP Client, etc. all behave the same way) — libraries don't ship a log backend so they don't conflict with whatever you're already using.

Pick one based on your context:

ContextRecommendedNotes
Production, no Spring Bootlogback-classicBattle-tested, async, structured logging
Production, with Spring Bootnothing — already thereSpring Boot Starter brings logback-classic transitively
CLI / small toolslf4j-simplePlain console output, one extra dep
Tests onlyslf4j-simple (test scope)What most TnsAI examples use
No logs wantedslf4j-nopSilently drops every log call
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.5.18</version>
</dependency>

SLF4J Simple (tests / CLI)

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>2.0.17</version>
    <scope>test</scope>
</dependency>

Drop <scope>test</scope> if you want it on the production classpath too.

Silence all logging

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-nop</artifactId>
    <version>2.0.17</version>
</dependency>

Environment variables

VariablePurpose
ANTHROPIC_API_KEYClaude API key
OPENAI_API_KEYOpenAI API key
BRAVE_API_KEYBrave Search API key
TAVILY_API_KEYTavily Search API key

For the full list, see reference/configuration.

Next

On this page