Char Memory
⭐ 3 Things You Need To Know
- Enable the Memory Feature in your Char Config.
- By default, conversations trimmed due to Context limitations are added to the Memory. You can disable this to rely solely on Memory you've provided via files or manual text input.
- Use this feature to analyze large amounts of text content (that wouldn't fit into the Context).
More Info: Devlog #4
How Can I Add Entries?
You can add entries in the memory view (see widget and chatview/testview sidepanel → Inspect Char Memory). Conversations that overflow get automatically added (if not disabled). Entered text is chunked into max 300 tokens per entry.
❓How Does It Work?
A specialized AI model ensures that text is translated and stored in a vector database.
Each time you chat, your input text is compared with the data in the store and
- (R)etrieval: the most relevant text gets retrieved.
- (A)ugmented: the current context gets augmented with the retrieved text (see
{{memory}}in the Char Config/automatic prepend). - (G)eneration: the model generates the new text based on past/relevant information.
Besides documents and large texts as knowledge sources, the intended use is to persist long-running conversations, so chat only gets added on context overflow. Best practice: configure your widget to always start from the last conversation and avoid resets (Configure Widget → Additional Settings → Autoload the last conversation).
From time to time, manually compress or transform entries into more meaningful summaries using the memory view and AI.
Memory Scope
Chat Menu
Storage per Char
Widget
Storage per Widget
How Can I Test It?
To test the functionality, specify either the {{memory}} token in your template or use aiprepend, preferably the latter. If you include {{memory}} directly in the template, it will slow down performance (If you omit it entirely, it will be automatically appended to the end of the template). Token caching becomes less effective, especially when dynamic content like memory is injected too early. The later you introduce it, the better the efficiency.
Then add a piece of text or document via the memory view, like "The secret is 42" and ask a follow-up question like: "What is the secret?"
The {{memory}} placeholder will then be replaced with relevant memory entries, based on the context of your input.
Use Settings → Chat → Debug: Context to see exactly what's sent to the AI. It reveals the full context sent, including memory entries.