Core Concepts
Common Mistakes
This is the catalogue of mistakes the codebase actively defends against — at the schema layer, the validator layer, the route layer, and the service layer. Each entry below maps to real validation logic.
Input rejected at the edge
| Mistake | Server response |
|---|---|
text shorter than ~10 characters after strip. | Schema validation 422. |
Empty/whitespace-only text or content. | 422. |
environment not in development/staging/production. | 422. |
importance outside 0..1. | 422. |
Low-value input skipped silently
Greetings, "ok thanks", and other chatter are caught by an internal low-value detector. The API returns 2xx with status="skipped" — not an error. Treat skipped as a business outcome, not a transport failure.
Rejected by the semantic validator
- Generic summaries — patterns like "This is a file" or "Untitled".
- Metadata-only content — JSON blobs, URLs, or arrays with no semantic substance.
- Redundant
key_points— pairs with more than 80% word overlap. - Vague filler language — text built from padding phrases ("the data shows", "contains information about") without concrete facts.
Treating <code>ttl_minutes</code> as importance
ttl_minutes is an absolute deadline that drives expires_at. It does not weight ranking. Use importance for weighting, ttl_minutes for hard expiry.
Cross-tenant leakage attempts
- Sending body
user_idhoping the server will trust it — overwritten with the resolved end-user. - Setting
environment,project_id, oruser_idin metadata to bypass the column — ignored; reads still filter on the columns. - Using an API key from one tenant with an
X-Tenant-IDfor another — 403.
Embedding-model pitfalls
- Switching the tenant default model without re-embedding existing rows — query and row dimensions stop matching, recall silently drops.
- Pre-computing embeddings on the client — the platform re-embeds on the server using semantic-enriched text; client-side vectors are not used.
Header pitfalls
- JWT request that also sends
X-End-User-ID— the header is ignored. Confusing in logs. - Service-auth memory call that omits
X-End-User-ID— 400. - Sending
X-Project-IDfor a project that does not belong to the resolved tenant — 403.
Identifier pitfalls
- Storing
User.id(the integer) in the client — it is internal and may change shape. Storepublic_id. - Storing the raw refresh token instead of letting the auth flow handle rotation — the token's hash is on the server; the plaintext is not.
- Parsing
project_idshape in the client — treat it as opaque.
Lifecycle pitfalls
- Polling
/memory/queryto see whether a delete completed — listen for the lifecycle event instead. - Assuming a soft-deleted memory is gone — it is recoverable until
hard_delete_at. - Calling
/memory/user/purgefor routine cleanup — it is a one-shot, irreversible action.