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.
What an end_user_id does
Section titled “What an end_user_id does”| 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.
Store a fact directly
Section titled “Store a fact directly”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”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).
Use the memories
Section titled “Use the memories”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:
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.
List, delete, erase
Section titled “List, delete, erase”# 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 memorycurl -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 historycurl -X DELETE https://api.beru.airesearchlabs.si/v1/end-users/user_123 \ -H "Authorization: Bearer $BERU_API_KEY"