Overview
The profile endpoint returns a pre-formatted context string for session start injection. It assembles user preferences, guidelines, recent memories, gate rules, and project-specific context into a ready-to-use prompt section.Endpoint
GET
/api/memory/profile
API Key required
Query Parameters
Project identifier for project-specific context (e.g.,
org/repo)Maximum token budget for the context. Content is truncated if exceeded (~4 chars per token).
Response
Indicates if the operation was successful
Pre-formatted context string with markdown sections ready for injection into the session prompt
Count of each component type included in the context:
Number of user preferences included
Number of foundational principles included (tagged with
foundation or constitution)Total guidelines included (foundation + regular)
Number of recent memories from last 24 hours
Total number of active gate rules (summary only, not full rules)
Number of project-specific memories included
Estimated token count for the context string (~4 chars per token)
Context Structure
The context string includes the following sections (when available):- Your Preferences - Up to 5 user preferences from the
preferencescategory - Foundational Principles - Up to 5 foundation guidelines (tagged
foundationorconstitution) - Guidelines - Up to 5 regular guidelines (non-foundational)
- Gate Rules - Count summary with note that rules are checked automatically on tool use
- Recent Context (last 24h) - Up to 5 recent memories excluding preferences, guidelines, and gate-rules
- Project Context - Up to 3 project-specific memories (if project parameter provided)
- Memory Conflicts Detected - Up to 3 unresolved conflicts (if any exist)
Foundation Guidelines
Guidelines are considered foundational when:- Tagged with
foundationorconstitution, OR - Source ref starts with
foundation:constitution