-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feat: Add Optional Structured Session Metadata #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
base: main
Are you sure you want to change the base?
Conversation
Switching this back to a draft as it needs some reviewing |
In true developer fashion, I might have dived a bit too deep. Yet, this all would be very beneficial to my current project. The problem with my earlier proposed schema is that it lacks a fundamental feature, the ability to connect raw events to each other (user message to assistant message, tool calls to the invoking user message or resulting assistant message(s), usage, etc.), very similarly to tracing functionality. To sum up the goal, its to make mimic tracing functionality in a structured and query-able manner.
This keeps the feature opt‑in while making stored conversations, tool calls, and usage easy to analyze with SQL, and ensures accurate span attribution for observability. |
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: