[AutoLoRA P1] Export Claude Conversation Trajectories #1102

Closed
opened 2026-03-23 17:29:42 +00:00 by perplexity · 1 comment
Collaborator

Export Claude Conversation Trajectories

Priority: P1-Important
Assignee: Alexander
Epic: #1091 — Project Bannerlord
Pipeline: AutoLoRA Sovereignty Loop (Step 3 of 7)
Blocked by: [AutoLoRA P0] Audit Hermes Agent Training Infrastructure


Context

Using whatever was found in the audit, export Claude conversation history into a format suitable for LoRA fine-tuning. The Hermes harness has built-in export to ShareGPT format.

What To Do

If hermes export exists:

hermes export --format sharegpt --output ~/timmy-training-data.jsonl

If it doesn't exist as CLI, look for it in Python:

grep -r "def.*export\|sharegpt\|to_sharegpt" <hermes-agent-path> --include="*.py"

Check these locations:

  • agent/trajectory.py
  • trajectory_compressor.py
  • hermes_state.py (the SessionDB class)

May need to call directly from Python:

from hermes_agent.agent.trajectory import <export_function>
<export_function>(output_path='~/timmy-training-data.jsonl')

If neither works, extract manually from SQLite:

sqlite3 <session-db-path> "SELECT * FROM messages ORDER BY created_at;" > raw_messages.txt
# Then write a conversion script

Validate the output:

# How many conversations?
wc -l ~/timmy-training-data.jsonl
# What does one look like?
head -1 ~/timmy-training-data.jsonl | python3 -m json.tool
# Do they contain tool calls?
grep -c "tool_call\|function_call\|tool_use" ~/timmy-training-data.jsonl

Done When

  • Training data exported to a .jsonl file
  • File contains tool-calling conversations (not just text chat)
  • At least 100 examples (more is better, 500+ is ideal)
  • Sample posted as comment so we can verify the format
## Export Claude Conversation Trajectories **Priority:** P1-Important **Assignee:** Alexander **Epic:** #1091 — Project Bannerlord **Pipeline:** AutoLoRA Sovereignty Loop (Step 3 of 7) **Blocked by:** [AutoLoRA P0] Audit Hermes Agent Training Infrastructure --- ### Context Using whatever was found in the audit, export Claude conversation history into a format suitable for LoRA fine-tuning. The Hermes harness has built-in export to ShareGPT format. ### What To Do **If `hermes export` exists:** ```bash hermes export --format sharegpt --output ~/timmy-training-data.jsonl ``` **If it doesn't exist as CLI, look for it in Python:** ```bash grep -r "def.*export\|sharegpt\|to_sharegpt" <hermes-agent-path> --include="*.py" ``` **Check these locations:** - `agent/trajectory.py` - `trajectory_compressor.py` - `hermes_state.py` (the SessionDB class) **May need to call directly from Python:** ```python from hermes_agent.agent.trajectory import <export_function> <export_function>(output_path='~/timmy-training-data.jsonl') ``` **If neither works, extract manually from SQLite:** ```bash sqlite3 <session-db-path> "SELECT * FROM messages ORDER BY created_at;" > raw_messages.txt # Then write a conversion script ``` **Validate the output:** ```bash # How many conversations? wc -l ~/timmy-training-data.jsonl # What does one look like? head -1 ~/timmy-training-data.jsonl | python3 -m json.tool # Do they contain tool calls? grep -c "tool_call\|function_call\|tool_use" ~/timmy-training-data.jsonl ``` ### Done When - [ ] Training data exported to a `.jsonl` file - [ ] File contains tool-calling conversations (not just text chat) - [ ] At least 100 examples (more is better, 500+ is ideal) - [ ] Sample posted as comment so we can verify the format
claude self-assigned this 2026-03-23 17:54:06 +00:00
Collaborator

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1121

What was done:

Created scripts/export_trajectories.py — AutoLoRA Step 3/7 export tool.

Reads from logs/session_*.jsonl (preferred, includes tool calls) or falls back to data/chat.db, groups entries into conversation windows (30-min gap = new conversation), and outputs ShareGPT-format JSONL suitable for Hermes 4 LoRA fine-tuning.

# Basic export
python scripts/export_trajectories.py

# Validate output
python scripts/export_trajectories.py --validate-only --output ~/timmy-training-data.jsonl

# Require at least 100 examples (exit 1 if not)
python scripts/export_trajectories.py --min-examples 100

Notes: No live conversation data exists yet in this worktree (no logs/ or data/chat.db). The script will produce an empty file and print instructions. Conversations need to be run first. 26 unit tests added and passing.

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1121 **What was done:** Created `scripts/export_trajectories.py` — AutoLoRA Step 3/7 export tool. Reads from `logs/session_*.jsonl` (preferred, includes tool calls) or falls back to `data/chat.db`, groups entries into conversation windows (30-min gap = new conversation), and outputs ShareGPT-format JSONL suitable for Hermes 4 LoRA fine-tuning. ```bash # Basic export python scripts/export_trajectories.py # Validate output python scripts/export_trajectories.py --validate-only --output ~/timmy-training-data.jsonl # Require at least 100 examples (exit 1 if not) python scripts/export_trajectories.py --min-examples 100 ``` **Notes:** No live conversation data exists yet in this worktree (no `logs/` or `data/chat.db`). The script will produce an empty file and print instructions. Conversations need to be run first. 26 unit tests added and passing.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1102