Interface SearchableSessionStore

All Superinterfaces:
SessionStore
All Known Implementing Classes:
SearchableFileSessionStore

public interface SearchableSessionStore extends SessionStore
Extended session store with search capabilities.

Usage


 SearchableSessionStore store = new SearchableFileSessionStore(".tnsai/history/");

 // Simple text search
 List<SessionSearchResult> results = store.search("authentication bug");

 // Advanced search with query builder
 SessionQuery query = SessionQuery.builder()
     .text("authentication")
     .agent("code-assistant")
     .outcome(SessionOutcome.SUCCESS)
     .lastDays(7)
     .limit(10)
     .build();

 List<SessionSearchResult> results = store.search(query);
 
Author:
TnsAI Team
  • Method Details

    • file

      static SearchableSessionStore file(String basePath)
      Creates a searchable file-based session store.
      Parameters:
      basePath - the base directory path
      Returns:
      searchable session store
    • search

      default List<SessionSearchResult> search(String text)
      Searches sessions with a simple text query.
      Parameters:
      text - the text to search for
      Returns:
      list of search results, sorted by relevance
    • search

      Searches sessions with a query.
      Parameters:
      query - the search query
      Returns:
      list of search results, sorted by relevance
    • findSimilar

      List<SessionSearchResult> findSimilar(String sessionId, int limit)
      Gets sessions similar to the given session.
      Parameters:
      sessionId - the session to find similar sessions for
      limit - maximum results
      Returns:
      list of similar sessions
    • findByToolUsage

      List<AgentSession> findByToolUsage(String toolName)
      Searches for sessions containing a specific tool call.
      Parameters:
      toolName - the tool name
      Returns:
      list of matching sessions
    • getStats

      Gets statistics about sessions.
      Returns:
      session statistics