Skip to content
← All docs

niyra_memories + niyra_remember — memory access

Search Niyra's vector memory store and add new memories from your own app. The same store powers Niyra's answers.

niyra_memories + niyra_remember

Niyra runs a personal vector memory store, populated automatically from every conversation. These two tools let your code read from it and add to it.

niyra_memories — search

MethodPathAuthScope
POST/v1/public/memoriesBearer tokenniyra:memories:read

Request

{
  "query": "what coffee shop does the user love",
  "limit": 10
}
FieldTypeRequiredNotes
querystringyesFree-text search query. Embedded server-side.
limitintnoMax results, 1..50. Default 10.

Response

{
  "memories": [
    {
      "id": "mem_abc",
      "content": "User's favorite coffee shop is Tartine in Mission, SF.",
      "source": "auto_extracted",
      "created_at": "2026-04-18T12:00:00Z",
      "similarity": 0.87
    }
  ]
}

Results are ordered by cosine similarity, descending. Anything below ~0.5 similarity is usually noise.

niyra_remember — add

MethodPathAuthScope
POST/v1/public/rememberBearer tokenniyra:memories:write

Request

{
  "content": "User prefers async standups over morning meetings.",
  "source_hint": "from my onboarding flow"
}
FieldTypeRequiredNotes
contentstringyesThe memory text. 5..2000 chars.
source_hintstringnoOptional context — surfaces in the memory's source field.

Response

{
  "id": "mem_new",
  "content": "User prefers async standups over morning meetings.",
  "source": "agent",
  "created_at": "2026-06-11T20:00:00Z"
}

Code examples

curl

# Search
curl -X POST https://api.niyra.ai/v1/public/memories \
  -H "Authorization: Bearer pat_…" \
  -H "Content-Type: application/json" \
  -d '{"query": "favorite coffee", "limit": 5}'

# Add
curl -X POST https://api.niyra.ai/v1/public/remember \
  -H "Authorization: Bearer pat_…" \
  -H "Content-Type: application/json" \
  -d '{"content": "User is allergic to shellfish."}'

Python

import os, requests

H = {"Authorization": f"Bearer {os.environ['NIYRA_TOKEN']}"}

# Search
r = requests.post(
    "https://api.niyra.ai/v1/public/memories",
    headers=H, json={"query": "favorite coffee", "limit": 5},
)
for m in r.json()["memories"]:
    print(f"{m['similarity']:.2f}  {m['content']}")

# Add
requests.post(
    "https://api.niyra.ai/v1/public/remember",
    headers=H, json={"content": "User is allergic to shellfish."},
)

Errors

StatusCodeMeaning
400invalid_requestMissing query / content, or content out of length bounds
401invalid_tokenToken revoked/expired/unknown
403insufficient_scopeToken lacks the relevant memory scope
429rate_limit_exceededPer-token budget exhausted

Related

FAQ

Where do these memories come from?
Niyra extracts them from conversations automatically (chat, channels, voice). niyra_remember lets your code add to the same store.
Can I delete memories via API?
Not yet — only via the dashboard. The API surface today is read + add. Deletion will land in a future release.
For AI:.md.txt