Skip to content

Per-user memory

Your users are end users in Beru. You identify each one with your own id for them (end_user_id: up to 255 characters, for example your database id). Beru creates the end user the first time it sees the id. Never send names or email addresses as the id.

Where Effect
POST /v1/documents (end_user_id form field) The document is private to that person
POST /v1/answer, POST /v1/retrieve Searches shared documents plus that person’s private ones, and recalls their memories
POST /v1/memories Stores facts about that person
DELETE /v1/end-users/{end_user_id} Erases everything about them

Without an end_user_id, only shared documents are searched. One end user never sees another’s documents or memories.

Terminal window
curl https://api.beru.airesearchlabs.si/v1/memories \
-H "Authorization: Bearer $BERU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"end_user_id": "user_123", "fact": "Prefers morning appointments", "category": "preference"}'

Categories: goal, preference, condition, history, other. A near-duplicate updates the existing fact; a fact that contradicts an older one supersedes it.

Or let Beru extract facts from a conversation

Section titled “Or let Beru extract facts from a conversation”
Terminal window
curl https://api.beru.airesearchlabs.si/v1/memories \
-H "Authorization: Bearer $BERU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"end_user_id": "user_123", "messages": [
{"role": "user", "text": "I just moved to Leeds and I am allergic to latex."},
{"role": "assistant", "text": "Thanks, noted."}
]}'

This returns 202 and extracts facts in the background (up to 50 messages per call, at least one from the user).

Ask with the same end_user_id. Answers may cite a memory as [M1]; used_memories in the response shows which facts were recalled and whether each was cited:

Terminal window
curl https://api.beru.airesearchlabs.si/v1/answer \
-H "Authorization: Bearer $BERU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "Which appointment slots suit me?", "end_user_id": "user_123"}'

Memories personalise answers; they are never used as a source for prices, policies or medical facts.

Terminal window
# List (add &query=… to search)
curl "https://api.beru.airesearchlabs.si/v1/memories?end_user_id=user_123" \
-H "Authorization: Bearer $BERU_API_KEY"
# Delete one memory
curl -X DELETE https://api.beru.airesearchlabs.si/v1/memories/MEMORY_ID \
-H "Authorization: Bearer $BERU_API_KEY"
# Erase everything about one person: private documents and files, memories, messages, question history
curl -X DELETE https://api.beru.airesearchlabs.si/v1/end-users/user_123 \
-H "Authorization: Bearer $BERU_API_KEY"