Skip to content

Feat: Add Optional Structured Session Storage #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

habema
Copy link
Contributor

@habema habema commented Aug 14, 2025

Resolves #1385

This PR introduces an optional structured storage mode to SQLiteSession to improve the observability and query-ability of conversation histories.

When a user initializes a session with structured=True, two new tables are created and populated alongside the existing raw JSON log:

  • agent_conversation_messages: Stores distinct user, assistant, and system messages.
  • agent_tool_calls: Records tool call invocations and their corresponding outputs.

This makes it significantly easier to analyze and debug agent interactions using standard SQL, addressing the limitations of querying JSON blobs.

Key points:

  • The feature is opt-in. Existing implementations are unaffected.
  • Foreign key constraints ensure data integrity when items are popped or sessions are cleared.
  • Includes comprehensive unit tests and updated documentation.

@seratch seratch added documentation Improvements or additions to documentation enhancement New feature or request feature:sessions labels Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request feature:sessions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Database schema for conversations could be better
2 participants