Memory
The RPGGO game engine automatically performs a series of engineering optimizations and algorithmic recalls on the dialogue history between users and AI to enhance the quality of conversations.
Developers have the flexibility to retrieve the raw NPC memory (dialogue history) at any time, allowing them to insert custom dialogues at appropriate intervals to enrich the memory content.
Get Memory by Session
Retrieve the entire conversation history of the current session using the session ID.
POST
https://api.rpggo.ai/open/game/memory
Request Body
session_id*
String
session ID, must be an ongoing game session id
Developers can retrieve the complete conversation records of the current session from the memory_item
array in response.
botIndex
corresponds to the NPC ID, allowing you to filter memories for a specific NPC using this field.message
andreply
fields represent a user-AI dialoguetype
field distinguishes memory types. 0 for normal interactions via the llm and 1 for dialogues stored through theopen/game/recordmemory
API.
Record Memory
POST
https://api.rpggo.ai/open/game/recordmemory
Request Body
session_id*
String
session ID, must be an ongoing game session id
chats*
List
A dictionary with three fields: npc_id
, message
, and reply
Before invoking the recordmemory
API, it is essential to initiate a game to obtain a session id or use an already ongoing game. Memories are recorded in chronological order based on the invocation of the interface, and developers can retrieve them through the /open/game/memory
interface.
In the chats
field, developers can submit one or multiple conversation histories. Each dialogue history consists of three elements:
npc_id
designates the associated NPCmessage
andreply
simulate user and AI interactions
Last updated