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
-
ClassDescriptionRepresents a complete agent session with all conversation turns.Represents a single turn in an agent conversation.File-based implementation of SessionStore.File-based session store with search capabilities.Extended session store with search capabilities.Session statistics.Outcome of an agent session.Query builder for searching sessions.Builder for SessionQuery.Search mode for text queries.Result of a session search operation.A matched turn within a session.Position of a match within content.Interface for storing and retrieving agent sessions.Types of conversation turns.