Overview
Creates or resumes a session in the LongMem database. Sessions track related observations and prompts across a coding workflow.Authentication
Requires Bearer token ifauthToken is configured in daemon settings.
Request
Unique identifier for the session (typically from your AI coding tool)
Project name or identifier
Working directory path for this session
Response
Always “ok” on success
Internal database ID for this session
Example
cURL
Response
Use Cases
Integration Setup
Call this when starting a new coding session to ensure observations are properly tracked:Session Recovery
If your tool crashes and restarts, calling/session/start with the same session_id will resume the existing session rather than create a duplicate.
Implementation Details
Fromdaemon/routes.ts:234-243:
- Creates a new session in SQLite if
session_iddoesn’t exist - Returns existing
db_idif session already exists - Caches the session ID mapping for fast lookups
- Sessions remain active until explicitly ended or daemon restarts
Error Responses
Missing session_id
Related
- POST /session/end - End a session
- POST /observe - Record tool executions in a session
- POST /prompt - Record prompts in a session