Skip to main content
POST
Commit Session
Commit a session to archive its messages and extract long-term memories. This operation:
  1. Archives current messages to history/archive_N/
  2. Extracts memories into 6 categories (profile, preferences, entities, events, cases, patterns)
  3. Clears active message buffer
  4. Updates context usage statistics

Request

Path Parameters

string
required
The session ID to commit

Headers

string
required
Your OpenViking API key for authentication
string
default:"application/json"
Must be application/json

Response

string
Response status (ok or error)
object
Commit operation result
string
The session identifier
string
Commit status (usually committed)
boolean
Whether messages were archived
number
Number of long-term memories extracted
number
Number of context usage records updated
object
Session statistics
number
Total conversation turns (user messages)
number
Number of contexts referenced
number
Number of skills called
number
Total memories extracted across all commits
number
Request processing time in seconds

Examples

Response Example

Memory Extraction Categories

The commit operation extracts memories into 6 categories:

User Memories

category
Location: viking://user/{user}/memories/profile.mdUser profile information (name, role, background, expertise)Merge strategy: Always merged into single profile.md file
category
Location: viking://user/{user}/memories/preferences/User preferences organized by topic (coding style, communication style, tool preferences)Merge strategy: Merged by topic when similar
category
Location: viking://user/{user}/memories/entities/Important entities (people, projects, organizations, concepts)Merge strategy: Merged when referring to same entity
category
Location: viking://user/{user}/memories/events/Significant events (decisions, milestones, incidents)Merge strategy: Created as separate events, not merged

Agent Memories

category
Location: viking://agent/{agent}/memories/cases/Problem-solution pairs (specific bugs fixed, issues resolved)Merge strategy: Created as separate cases, not merged
category
Location: viking://agent/{agent}/memories/patterns/Reusable patterns (workflows, processes, interaction patterns)Merge strategy: Merged when similar patterns detected

Memory Structure

Each memory is stored with three levels:

Archive Structure

Committed messages are archived in:

When to Commit

Auto-commit by Token Count

Commit at Natural Boundaries

Full Lifecycle Example

Best Practices

Always Track Usage Before Commit

Commit Regularly

Don’t let sessions grow too large:

Check Commit Results