Skip to main content

API Reference

Complete REST API reference for the Memory Module. Use these endpoints for direct integration, automation, or when MCP isn’t available.
Prefer MCP? Most users should use MCP Integration for seamless AI assistant integration. Use this API for custom integrations, automation scripts, or non-MCP tools.

Base URL

Authentication

All endpoints require Bearer token authentication:
Get your API key:
  1. Log into app.ulpi.io
  2. Navigate to your repository → Settings → API Keys
  3. Click “Generate New Key”
  4. Store securely (shown only once!)

Endpoints

POST /memories

Store a new memory. Request:
Parameters:
  • content (required, string): The information to store
  • sector (optional, string): episodic | semantic | procedural | emotional | reflective
  • tags (optional, array): List of tags for organization
  • source (optional, string): Where this came from
  • metadata (optional, object): Custom JSON metadata
Response:
Status Codes:
  • 201: Created successfully
  • 400: Invalid request format
  • 401: Unauthorized (bad API key)
  • 422: Validation failed
  • 429: Rate limit exceeded

POST /memories/search

Search memories with hybrid ranking. Request:
Parameters:
  • query (required, string): Search text
  • limit (optional, int): Results to return (default: 10, max: 100)
  • sector (optional, string): Filter by cognitive sector
  • tags (optional, array): Filter by tags
  • min_salience (optional, float): Minimum salience threshold (0.0-1.0)
  • expand_waypoints (optional, bool): Enable context expansion (default: true)
  • max_hops (optional, int): Waypoint traversal depth (default: 3, max: 5)
Response:
Status Codes:
  • 200: Success
  • 400: Invalid request
  • 401: Unauthorized

GET /memories/

Retrieve specific memory by ID. Request:
Response:
Status Codes:
  • 200: Success
  • 404: Memory not found
  • 401: Unauthorized
Note: Accessing a memory increments access_count and updates last_accessed_at.

PATCH /memories/

Update memory content or metadata. Request:
Parameters:
  • content (optional, string): Update the content
  • tags (optional, array): Replace tags
  • source (optional, string): Update source
  • metadata (optional, object): Replace metadata
Response:
Status Codes:
  • 200: Updated successfully
  • 404: Memory not found
  • 422: Validation failed
Note: Cannot change sector after creation. Embeddings regenerate automatically.

POST /memories//reinforce

Explicitly boost memory salience. Request:
Parameters:
  • profile (optional, string): Reinforcement strength
    • quick_refresh: +0.05
    • maintenance: +0.10 (default)
    • deep_learning: +0.15
    • emergency: +0.25
Response:
Status Codes:
  • 200: Reinforced successfully
  • 404: Memory not found

GET /memories//waypoints

Get semantic connections for a memory. Request:
Parameters (query string):
  • limit (optional, int): Number of waypoints (default: 20)
  • min_weight (optional, float): Minimum similarity (default: 0.75)
Response:

DELETE /memories/

Permanently delete a memory. Request:
Response:
Status Codes:
  • 204: Deleted successfully
  • 404: Memory not found
Warning: This is permanent and cannot be undone!

POST /memories/prune

Remove low-salience memories in bulk. Request:
Parameters:
  • threshold (optional, float): Salience threshold (default: 0.1)
  • sector (optional, string): Only prune specific sector
  • dry_run (optional, bool): Preview without deleting (default: false)
Response:

GET /memories/stats

Get system statistics. Request:
Response:

Rate Limits

Headers returned:
429 Response:

Error Responses

All errors return consistent JSON format:
Status Codes:
  • 400: Bad Request (malformed JSON, invalid parameters)
  • 401: Unauthorized (missing/invalid API key)
  • 403: Forbidden (valid auth but no access)
  • 404: Not Found (resource doesn’t exist)
  • 422: Unprocessable Entity (validation failed)
  • 429: Too Many Requests (rate limit exceeded)
  • 500: Internal Server Error

Pagination

For endpoints returning lists, use cursor-based pagination: Request:
Response:

Webhooks

Coming soon! Subscribe to memory events:
  • memory.created
  • memory.accessed
  • memory.pruned
  • waypoint.created

SDKs

Official SDKs available:

JavaScript / Node.js

Python

Go

Community SDKs: PHP, Ruby, Rust (see GitHub)

Code Examples

JavaScript / Node.js

Python

cURL


Best Practices

When storing multiple memories, use async/parallel requests to improve throughput. Don’t wait for each to complete sequentially.
Always implement retry logic with exponential backoff for 5xx errors and rate limits (429).
  • Never commit keys to version control
  • Use environment variables
  • Rotate keys quarterly
  • Use separate keys per environment
  • Cache search results when possible
  • Implement client-side rate limiting
  • Monitor X-RateLimit-Remaining header
  • Upgrade plan if consistently hitting limits
For large datasets, always use pagination. Don’t request all memories at once.

Support

API Issues: Response Times:
  • Starter: 48 hours
  • Pro: 24 hours (priority)
  • Enterprise: 4 hours (dedicated)

Next Steps

MCP Integration

Use with AI assistants instead of direct API

Best Practices

Optimization tips and strategies

Workflows

Real-world integration examples

Getting Started

Quick setup guide