Package com.tnsai.session


package com.tnsai.session
Session history and knowledge extraction for agents.

This package provides mechanisms to store, search, and learn from agent conversation history.

Quick Start


 // Create session store
 SessionStore store = SessionStore.file(".tnsai/history/");

 // Start a session
 AgentSession session = AgentSession.start("my-agent", "/path/to/project");
 session.addUserMessage("Fix the authentication bug");
 session.addAssistantMessage("I'll analyze the code...");
 session.addToolCall("read_file", Map.of("path", "AuthService.java"));
 session.success();

 // Save session
 store.save(session);

 // Search sessions
 List<AgentSession> recent = store.findRecent(10);
 List<AgentSession> byTag = store.findByTag("security");
 

Storage Structure

 .tnsai/history/
 ├── 2026-02-05/
 │   ├── session-abc123.json
 │   └── session-def456.json
 ├── 2026-02-04/
 │   └── session-ghi789.json
 └── index.json
 
Author:
TnsAI Team