Project Memory

Persistent context that travels with every API request.

Overview

Every OpenAI/Anthropic API call is stateless. You re-paste your stack, conventions, and project context on every single request. This wastes tokens and is deeply frustrating.

Nascentist solves this at the API level with Project Memory — a persistent context store tied to your API key. On every subsequent request, relevant memories are automatically retrieved and injected into the system prompt. Zero extra work.

Quick Start

1. Store your tech stack

curl -X POST https://api.nascentist.ai/v1/memory \
  -H "Authorization: Bearer nsc_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "key": "tech_stack",
    "value": "Python 3.11, FastAPI, PostgreSQL 15, Redis",
    "type": "stack",
    "scope": "global"
  }'

2. Every request now includes this context

curl -X POST https://api.nascentist.ai/v1/complete \
  -H "Authorization: Bearer nsc_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Add caching to this function",
    "inject_memory": true
  }'

# The model already knows you use Redis!

Memory Types

TypeUse CaseExample
stackTech stack infoPython 3.11, FastAPI, PostgreSQL
conventionCode style rulesUse snake_case, 4-space indent
contextProject contextPayment microservice for e-commerce
preferenceAI behavior prefsAlways use type hints
factGeneral factsUses JWT for auth

Scoping

  • global — Included in all requests (default)
  • project — Only for requests with this project_id
  • key — Only for requests with this specific API key

Best Practices

  • Keep values concise — each memory adds tokens to every request
  • Use specific keys: tech_stack not info
  • Start with 3-5 core memories (stack, style, purpose)
  • Use scope: "key" for environment-specific config

API Reference

GET /v1/memory

List all active memories for your API key.

POST /v1/memory

Create or update a memory (upsert by key). Supports single object or array for bulk.

Body: { key, value, type?, scope? }

POST /v1/memory/search

Semantically search memories by query string using pgvector cosine similarity.

Body: { query: string, limit?: number, threshold?: number }

POST /v1/memory/extract

Auto-extract patterns and context from a code snippet (zero inference cost).

Body: { code: string, language: string }

GET /v1/memory/stats

Returns memory health score (0-100) and recommendations.

GET /v1/memory/:id

Get a single memory by ID.

PATCH /v1/memory/:id

Update key, value, type, or scope.

DELETE /v1/memory/:id

Soft delete (sets is_active = false). Use DELETE /v1/memory?all=true to clear all.

Limits & Performance

  • Max 50 memories per user
  • Key: max 100 characters
  • Value: max 2000 characters
  • Similarity extraction leverages fast TF-IDF bigram arrays on the edge (~0ms latency)