1. Settings Management
Adventists - API Doc
  • Overall
  • v2.5 Updates
  • Quick Start
  • TCP - Chat With Voice
    • Emoji Mode Integration Guide
    • Connect with TCP
    • Connect with VAD
    • Connect with MCP
    • Get Token
      POST
  • Settings Management
    • Args Description
    • Hippo - Character Memory Management Microservice
    • Device / Character Block Management
    • Template
      • Query Public Template List
      • Query Current Org Template (including private and public template)
      • Create Template
      • Query Template By ID
      • Modify Template
      • Delete Template
      • Send Memories To Template
    • NPC
      • Create Npc With Template
      • Create Npc Without Template
      • Query Npc By Id
      • Modify Npc
      • Delete Npc
      • Send Memories To Npc
      • Query Memories From Npc
    • Skills Book
      • Query Skills Book List
      • Start Create Skills Book Task
      • Upload Skills Book Content
      • Finish Create Skills Book Task
      • Query Progress Of Create Skills Book Task
    • Voice Texture
      • Upload Voice Texture
        • Upload Voice
        • Query Status Of Uploading Voice
      • Query Voice List
    • Hippo - API
      • Get the Personal Knowledge Graph (PKG) of the specified character
      • Retrieve relationship data for the specified character.
      • Retrieve diary data for the specified character.
      • Update the character's PKG.
      • Trigger Dream
      • Dialogue Memory API
      • Read Conversation Memory
    • Device / Character Block- API
      • Device/Character Ban
      • Device/Character Unban
      • Query Ban List
      • Query Single Ban Status
  • Other Chat Functions
    • Upload Pictures
      POST
  1. Settings Management

Hippo - Character Memory Management Microservice

Hippo is the memory management microservice for AnyoneAI, responsible for querying and managing Personal Knowledge Graphs (PKG), character relationships, diaries, and Dream (memory consolidation) processes.
Base URL:
Route Prefix: /api
Data Format: JSON
Encoding: UTF-8

API Summary#

MethodPathDescription
GET/api/pkg/{npcid}Query character PKG
PUT/api/pkg/{npcid}Update character PKG fields
GET/api/relationship/{npcid}Query character relationships
GET/api/diary/{npcid}Query character diary
POST/api/dream/{npcid}Trigger character dreaming (memory consolidation)

Data Management APIs#

Query PKG#

Retrieve the Personal Knowledge Graph for a specified character.
GET /api/pkg/{npcid}

Path Parameters#

ParameterTypeRequiredDescription
npcidstringYesUnique character identifier

Success Response (200)#

{
  "npcid": "abc123",
  "pkg": {
    "Name": "Xiao Ming",
    "Nickname": ["Mingming", "Little M"],
    "Hobbies": ["Reading", "Running"],
    "Important Friends": ["Xiao Hong"],
    "voice_registered": true
  }
}

Error Response (500)#

{
  "status": "error",
  "message": "Error details"
}

cURL Example#


Update PKG Fields#

Merge-update PKG fields for a character. This is not a full replacement.
PUT /api/pkg/{npcid}

Path Parameters#

ParameterTypeRequiredDescription
npcidstringYesUnique character identifier

Request Body#

{
  "updates": [
    {"key": "Hobbies", "value": "Swimming,Painting"},
    {"key": "Favorite Books", "value": ["Three-Body Problem", "One Hundred Years of Solitude"]}
  ]
}

Request Parameters#

ParameterTypeRequiredDescription
updatesarrayYesArray of update items, each containing key and value
updates[].keystringYesPKG field name
updates[].valuestring / arrayYesField value; multi-value fields can use comma-separated strings or arrays

Update Rules#

Multi-value fields: New values are deduplicated and appended to the end of the existing list. When exceeding the item limit, the latest N items are retained.
Field NameItem Limit
Nickname5
Important Friends10
Other Important People10
Important Appointments10
Favorite Books10
Favorite Movies10
Favorite Sports10
Hobbies10
Entertainment and Leisure10
Regular fields: Direct overwrite, string length limit is 1024 characters.
Ignore Rules:
Ignored if key is empty
Ignored if key is a protected field (voice_registered, face_registered)
Ignored if key is Name and the current name is non-empty

Success Response (200)#

{
  "status": "ok",
  "updated_fields": ["Hobbies", "Favorite Books"]
}

Error Responses#

400 - Invalid Parameters
{
  "status": "error",
  "message": "updates cannot be empty"
}
404 - Character Not Found
{
  "status": "error",
  "message": "NPC abc123 does not exist or has no PKG"
}
500 - Server Error
{
  "status": "error",
  "message": "Error details"
}

cURL Example#


Query Relationships#

Retrieve relationship data for a specified character.
GET /api/relationship/{npcid}

Path Parameters#

ParameterTypeRequiredDescription
npcidstringYesUnique character identifier

Success Response (200)#

{
  "npcid": "abc123",
  "relationship": {
    "entity_001": {
      "name": "Xiao Hong",
      "alias": ["Honghong"],
      "title": ["Classmate"],
      "remark": "Often plays basketball together"
    },
    "entity_002": {
      "name": "Teacher Zhang",
      "alias": [],
      "title": ["Class Teacher"],
      "remark": "Math teacher"
    }
  },
  "count": 2
}
FieldTypeDescription
npcidstringCharacter ID
relationshipobjectRelationship data, keys are entity IDs
relationship.{id}.namestringPerson's name
relationship.{id}.aliasarrayList of aliases
relationship.{id}.titlearrayList of titles
relationship.{id}.remarkstringRemarks
countnumberTotal number of relationship entries

Error Response (500)#

{
  "status": "error",
  "message": "Error details"
}

cURL Example#


Query Diary#

Retrieve diary data for a specified character, including historical summary (prior) and recent daily diary entries.
GET /api/diary/{npcid}

Path Parameters#

ParameterTypeRequiredDescription
npcidstringYesUnique character identifier

Success Response (200)#

{
  "npcid": "abc123",
  "prior": "Xiao Ming is a sports enthusiast, often playing basketball with friends...",
  "dailies": [
    {
      "date": "2026-04-08",
      "summary": "Went to the library with Xiao Hong today, discussed the new project plan..."
    },
    {
      "date": "2026-04-07",
      "summary": "Attended the department weekly meeting, shared last week's work progress..."
    }
  ],
  "count": 2
}
FieldTypeDescription
npcidstringCharacter ID
priorstringHistorical summary (merged memories outside the rolling window)
dailiesarrayRecent daily diaries, sorted by date
dailies[].datestringDate in YYYY-MM-DD format
dailies[].summarystringDaily diary summary
countnumberTotal number of diary entries

Error Response (500)#

{
  "status": "error",
  "message": "Error details"
}

cURL Example#


Dream API#

Trigger Dreaming#

Execute a complete Dream (memory consolidation) process for a specified character. The process consists of four stages:
1.
Scan: Scan recent conversation summaries to determine if there is new data
2.
Diary: Generate today's diary and manage the rolling window
3.
Extraction: Extract entities from conversations and update PKG and relationships
4.
Cleanup: Clean up expired vector data
POST /api/dream/{npcid}

Path Parameters#

ParameterTypeRequiredDescription
npcidstringYesUnique character identifier

Query Parameters#

ParameterTypeRequiredDefaultDescription
dry_runstringNofalseWhen set to true, only computes results without writing to the database

Success Response (200)#

{
  "status": "ok",
  "report": {
    "skipped": false,
    "diary": {
      "date": "2026-04-09",
      "diary_text": "Discussed travel plans with the user today...",
      "prior_merged": false,
      "overflow_count": 0
    },
    "extractions": {
      "entity_ops_count": 2,
      "pkg_updates_count": 3,
      "entity_ops": [...],
      "pkg_updates": [...],
      "rel_written": true,
      "pkg_written": true
    },
    "cleanup": {
      "content_hybrid_deleted": 5,
      "emotion_v2_deleted": 3
    },
    "error": null
  }
}

Report Fields#

FieldTypeDescription
skippedbooleanWhether skipped. When true, no new data was found and subsequent steps were not executed
diaryobject / nullDiary generation result. Contains date, diary_text, prior_merged, overflow_count
extractionsobject / nullEntity extraction result. Contains entity_ops_count, pkg_updates_count, rel_written, pkg_written
cleanupobject / nullExpired vector cleanup result. Contains content_hybrid_deleted, emotion_v2_deleted
errorstring / nullError message. Multiple errors are separated by semicolons
When skipped is true, diary, extractions, and cleanup are all null.
When dry_run=true, each step computes normally but does not write to the database. diary and cleanup may contain dry_run: true markers.

Error Response (500)#

{
  "status": "error",
  "message": "Error details"
}

cURL Examples#


Error Codes#

HTTP Status CodeDescription
200Request successful
400Invalid request parameters (e.g., updates is empty)
404Resource not found (e.g., NPC does not exist or has no PKG)
500Internal server error
All error responses return JSON format:
{
  "status": "error",
  "message": "Detailed error description"
}
修改于 2026-04-23 03:48:58
上一页
Args Description
下一页
Device / Character Block Management
Built with