@AiService
interface ReviewAnalyzer {
@Operation("Analyze the sentiment of this review and extract key topics.")
suspend fun analyze(text: String): Analysis
}
data class Analysis(
val sentiment: Sentiment,
val topics: List<String>,
val requiresFollowup: Boolean
)
Governed AI Workflows for Java and Kotlin.
Runtime policy, human approval, controlled model and tool access, sovereignty controls, and reviewable execution evidence — inside your JVM stack.
What "governed" means in practice
TramAI enforces the execution boundary around your AI workloads — not just the model call:
Governed AI, by Design
Building the agent is one problem. Governing it in production is another. TramAI focuses on the governance boundary.
AI Agent Governance
The category pillar: what it means to govern agents in production, and where runtime authority sits in the stack.
Runtime Governance
Observability records what happened. Governance decides what is allowed to happen — before it happens.
Tool Governance
ALLOW, DENY, and REQUIRE_APPROVAL decisions at tool exposure and execution boundaries.
Human Approval
Human-in-the-loop approval as a durable runtime state transition, not a prompt instruction.
@AiService
public interface ReviewAnalyzer {
@Operation(
prompt = "Analyze the sentiment of this review and extract key topics."
)
Analysis analyze(String text);
}
public record Analysis(
Sentiment sentiment,
List<String> topics,
boolean requiresFollowup
) {}Define your contract, Tramai handles the rest: prompt construction, governed model routing, and type-safe parsing.
Choose Your Path
Tramai is modular. Start where you are and grow as needed.
Spring Boot
Native integration with Spring Boot 3.x. Auto-configuration and Spring-style AI services.
Standalone
Zero-dependency core for CLI apps or any JVM project. Clean, builder-based configuration.
Local AI
Privacy-first processing with Ollama. Run powerful models locally without API keys.
Modules
Providers
Guides
JVM Ready
Providers: OpenAI, Anthropic, Gemini, DeepSeek, Ollama, Bedrock, Azure OpenAI, and more
AI as a 4th Software Layer
TramAI adds @AiService as a first-class architectural layer alongside your controllers, services, and repositories. Same rigor. Same injection model. Same testability.
Governance-First, Not Just Another Framework
LangChain4j and Spring AI build and orchestrate AI workloads. TramAI governs the execution boundaries around them. No marketing — just what each product does.
| Capability | Tramai | LangChain4j | Spring AI |
|---|---|---|---|
| Model integration | Core | Core | Core |
| Typed structured output | Automatic JSON schema from data classes, parse-and-retry | Manual schema definition | StructuredOutputConverter |
| Runtime policy enforcement | Allow/deny decisions at provider and tool boundaries (6 enforcement points) | Not a primary design focus | Not a primary design focus |
| Classification-aware routing | Data classification constrains provider zones (RESTRICTED → LOCAL only) | External integration required | External integration required |
| Provider trust zones | LOCAL / EU_CLOUD / GLOBAL_CLOUD zones enforced at runtime | Varies by implementation | Varies by implementation |
| Tool permission policies | ALLOW / DENY / REQUIRE_APPROVAL at exposure and execution | Varies by implementation | Varies by implementation |
| Human approval lifecycle | Suspend/resume with cryptographically bound approval tokens | External integration required | External integration required |
| Governed fallback | Policy hook before provider fallback; fallback providers allowlisted | Varies by implementation | Varies by implementation |
| Auditability | SHA-256 hash-chained audit events for every policy decision | External logging | External logging |
| Execution evidence | Runtime evidence exporters (policy.decision, tool.permission) and evidence packs | External logging | External logging |
| Sovereign / local execution | Offline deployment mode, local-only routing, zero-egress options | Varies by implementation | Varies by implementation |
| Control plane (inventory, intervention, explainability) | Roadmap — TramAI 0.7.0 direction | — | — |
"Varies by implementation" and "external integration required" mean the capability is not a first-class part of the framework and depends on the surrounding system. The control-plane row is explicitly marked as TramAI roadmap direction, not shipped functionality.
Other frameworks can build and orchestrate AI workloads. TramAI specializes in governing their execution boundaries. See the AI agent governance pillar for the full reasoning.
