Overview
The foundation endpoint retrieves all guidelines tagged as foundational. These are core principles and constitutional rules that should govern the AI assistant’s behavior across all sessions and projects.Endpoint
GET
/api/memory/foundation
API Key required
Query Parameters
Project identifier to include project-specific foundational guidelines (e.g.,
org/repo). When provided, fetches both global and project-scoped foundation guidelines.Response
Indicates if the operation was successful
Array of foundational guideline documents
Unique document ID
Full guideline text
Document category (always
guidelines for foundation guidelines)Source reference (e.g.,
foundation:constitution, project:org/repo)Array of tags. Foundation guidelines have
foundation or constitution tag.Total number of foundation guidelines returned
Foundation Detection
A guideline is considered foundational when it meets ANY of these criteria:- Tags: Contains
foundationorconstitutiontag (case-insensitive) - Source Reference:
source_refstarts withfoundation:constitution(case-insensitive)
Retrieval Behavior
- Without project parameter: Returns all global foundation guidelines (category=
guidelines, foundation tags) - With project parameter: Returns both:
- Global foundation guidelines
- Project-specific foundation guidelines (source_ref=
project:{project})
- Queries document store directly (no semantic search)
- Limit: 50 guidelines