What Is a Session?
A session is a container for a conversation thread with Klaus. Each session has:- A title (e.g., “Complexity Science - March 3rd” or “Anderson Paper Notes”)
- A conversation history (all your questions and Klaus’s answers)
- A notes file (optional, for Obsidian integration)
- A timestamp (created and last updated)
The Session Sidebar
The left sidebar shows all your sessions, sorted by most recently updated.- Active session is highlighted in the accent color
- Session title shows the name you gave it (or “Untitled Session” by default)
- Exchange count shows how many Q&A pairs are in that session (e.g., “5 Q&A”)
- Timestamp shows when the session was last updated (e.g., “2 hours ago”, “Yesterday”, “Mar 3”)
Creating a New Session
Example titles:
- “Complexity Science - March 3rd”
- “Anderson ‘More is Different’ Paper”
- “Thermodynamics Review”
- “Reading Notes - Week of March 3rd”
Switching Sessions
Click any session in the sidebar to switch to it. Klaus:- Loads the conversation history for that session
- Clears the current session’s in-memory context
- Sets the active notes file (if one was set for that session)
- Updates the status bar to show the new session’s exchange count
Renaming a Session
You can rename any session, including the currently active one.
Deleting a Session
What gets deleted:
- The session’s conversation history (all exchanges)
- The session’s metadata (title, timestamps)
- The session’s notes file reference (but NOT the actual notes file in your Obsidian vault)
~/.klaus/klaus.db).
What Happens After Deletion
If you delete the currently active session, Klaus:- Creates a new “Untitled Session” if no other sessions exist
- Switches to the most recently updated session (if others exist)
- Clears the chat area and loads the new session’s history
Session History and Context
Klaus remembers your conversation history within the current session. This enables:Follow-Up Questions
Pronoun Resolution
Context Accumulation
As you ask more questions, Klaus builds up context about what you’re reading and what you’re interested in. This helps it give more relevant answers.Context Limits
Klaus does NOT send the entire session history with every question - that would be slow and expensive. Instead:- Short-term context: Klaus includes the last ~5 exchanges for follow-up questions
- Page-specific context: Klaus includes the current page image for page-grounded questions
- Knowledge profile: Klaus maintains a lightweight summary of topics you’ve discussed (stored in
klaus.db)
Session Persistence
Sessions are stored in~/.klaus/klaus.db, a SQLite database in your Klaus data directory.
What’s Stored
- Session metadata: ID, title, created timestamp, updated timestamp, notes file path
- Exchanges: User question, Klaus’s answer, timestamp, page image hash (not the full image)
- Search results: Web searches Klaus performed during each exchange (stored as JSON)
What’s NOT Stored
- Full page images: Only a 16-character hash of each image is stored (for deduplication)
- Audio recordings: Klaus doesn’t keep the WAV files after transcription
- API keys: Stored separately (Keychain on macOS,
config.tomlon Windows)
Resetting All Sessions
To clear all sessions and start fresh:- Close Klaus
- Delete
~/.klaus/klaus.db - Restart Klaus
Session-Specific Notes Files
When you set a notes file (see Obsidian Integration), Klaus associates it with the current session. How it works:- You set a notes file: “Set notes to complexity science slash march 3rd”
- Klaus saves that path to the current session in
klaus.db - When you switch to a different session, Klaus clears the active notes file
- When you switch back to the original session, Klaus restores that session’s notes file
Best Practices
1. One Session Per Paper or Topic
Create a new session for each distinct reading task:- Reading a new paper? New session.
- Switching to a different chapter? New session.
- Reviewing notes from last week? New session.
2. Use Descriptive Titles
Good titles make it easy to find past conversations:- Good: “Anderson ‘More is Different’ - Emergence”
- Good: “Thermodynamics Chapter 5 - Entropy”
- Bad: “Untitled Session”
- Bad: “Session 1”
3. Clean Up Old Sessions
Delete sessions you no longer need. If you saved important notes to Obsidian, the ephemeral conversation history is less critical.4. Combine with Obsidian Notes
Use sessions for your working conversation (questions, clarifications, tangents) and save key insights to Obsidian notes for long-term reference.5. Review Session History
Scroll through a session’s chat history to see what you asked and what Klaus answered. Click the replay button (▶) to hear any answer again.Session Statistics
The bottom-right corner of the status bar shows the current session’s exchange count:- “0 Q&A this session” - no exchanges yet (new session)
- “5 Q&A this session” - you’ve asked 5 questions and received 5 answers
Technical Details
Database Schema
Sessions are stored in thesessions table:
exchanges table:
Session IDs
Each session gets a UUID (e.g.,3f8e1a2b-4c5d-6e7f-8a9b-0c1d2e3f4a5b). Klaus displays the first 8 characters in logs for brevity.
Timestamps
Timestamps are stored as Unix epoch floats (seconds since 1970-01-01 00:00:00 UTC). The UI formats them as relative time (“2 hours ago”) or dates (“Mar 3”).Troubleshooting
Sessions Not Appearing in Sidebar
- Check the database - does
~/.klaus/klaus.dbexist? - Check logs - look for “Loaded X session(s)” at startup
- Restart Klaus - session list is loaded once at startup
Session History Not Loading
- Check the session ID - logs show the session ID when you switch sessions
- Check the exchanges table - use
sqlite3 ~/.klaus/klaus.dband runSELECT COUNT(*) FROM exchanges WHERE session_id = '<id>'; - Check for errors - Klaus logs exchange-loading failures at
ERRORlevel
”Untitled Session” Created on Every Launch
This is normal - Klaus always ensures at least one session exists. Rename it or delete it after creating a properly titled session.Next Steps
Obsidian Integration
Associate notes files with sessions
Overview
Return to the usage overview