TnsAI
TnsAI

TnsAI Framework

Official documentation for the TnsAI framework

A Java 21+ multi-agent framework built on BDI + Gaia methodology

License


Documentation Structure

This repository is organized as a learning path. Each section builds on the previous one.

Start Here

Zero to running agent in under 10 minutes.

Agents

Everything about building a single agent.

  • Fundamentals — Agents, roles, action system, events.
  • Behavior — Prompts, output parsing, streaming, variants, memory.
  • Reliability — Resilience, error handling, schema identity.
  • Advanced — Cognitive support, planner/reasoner handles, ensemble execution.

Capabilities

Pluggable building blocks that extend what an agent can do.

  • Tools — 62 POJO toolkits (~206 @Tool methods) across 29 categories, custom tools, registration.
  • Intelligence — Planning (GOAP/HTN), reasoning (ReAct/ToT), FSM, context, learning.
  • RAG — Knowledge base, strategies, production pipeline.
  • LLM — Providers, routing, caching, cost tracking, audio.

Multi-Agent

Systems of cooperating agents.

  • Topologies, workflows, council & voting, negotiation, judge, protocols, communication, auto team, delegation.

Observability

OpenTelemetry traces, metrics, structured logs, structured tracing for agent runs.

Validation

Invariant checks, guardrails, schema validation, content guardrails.

Contracts

Design-by-Contract for actions: JEXL preconditions, postconditions, and invariants (@Contract / ContractSpec).

Annotation Catalog

Every framework annotation grouped by area, with its runtime status (wired / partial / scaffold) so you know what actually takes effect.

Security

Evaluation

  • Evaluators, benchmarks, quality gates, LLM-as-judge, evaluation hooks.

Server

Run TnsAI as a backend.

MCP

Model Context Protocol — client, server, transports, registry.

Channels

External messaging adapters — Telegram, CLI, Email, Slack, Discord, WhatsApp.

Payments

Agent-to-agent settlement via the pluggable PaymentBroker SPI.

Sona

Self-hosted personal AI assistant built on TnsAI — the first concrete consumer of the framework.

  • Quickstart — Install, run, send your first Telegram message in 5 minutes.
  • How It Works — Gateway, BDI loop, channel adapter SPI, skills, with Mermaid diagrams.

Integrate

Bridges to other protocols and frameworks.

Reference

Look it up.

Tutorials

End-to-end walkthroughs.

Help


Framework Modules

All framework modules live in the TnsAI monorepo and ship at the same lockstep version via the BOM.

ModuleSourceDescription
Coretnsai-coreAgent lifecycle, Role, Action, tool dispatch, annotations
LLMtnsai-llmLLMClient implementations for 20+ providers
Intelligencetnsai-intelligenceFSM, planning, reasoning, RAG strategies
Coordinationtnsai-coordinationMulti-agent groups, topologies, voting, negotiation
Qualitytnsai-qualityObservability, security, validation
Evaluationtnsai-evaluationAgent evaluation and benchmarking
MCPtnsai-mcpModel Context Protocol client + server
Toolstnsai-toolsPOJO toolkits across web · file · DB · code · media · fintech · …
Channelstnsai-channelsTelegram / CLI / Email / Slack / Discord / WhatsApp adapters via SPI
Integrationtnsai-integrationCross-module integration tests + SCOP bridge
Servertnsai-serverJavalin HTTP/WebSocket agent server, RAG service layer
BOMtnsai-bomBill of Materials — consumer version pinning

External companion repositories:

RepositoryDescription
TnsAI.WebDocumentation website (Next.js + Fumadocs, tnsai.dev)
TnsAI.DocsOfficial documentation (this repo)
TnsAI.SonaPersonal AI assistant daemon (dogfooding)
TnsAI.PapersResearch publications

Contributing

Documentation contributions welcome. Guidelines:

  • All documentation must be in English.
  • Use clear, concise language.
  • Include code examples where applicable.
  • Follow the learning path: Start Here → Agents → Capabilities → Multi-Agent → Observability / Validation / Security / Evaluation → Server / MCP / Channels / Integrate → Reference.

License

Apache License 2.0


Part of the TnsAI FrameworkBuilding Intelligent Multi-Agent Systems

On this page