PrimeThink Documentation Help

Memory

It's important to understand that the memory system detailed here primarily enhances standard chats between you and AI assistants. To maintain privacy and appropriate context, these memory features are typically not active within multi-user group chats that include several human participants.

PrimeThink features a sophisticated memory system, similar to human memory, allowing the platform and its AI assistants to recall important information from past interactions and apply it effectively in future conversations during your standard chats. This ensures continuity, personalisation, and adherence to specific guidelines within those one-on-one or AI-only interactions.

The memory system organises information into different types, each serving a distinct purpose and having a specific priority level when accessed by the AI. When you interact with an assistant in a standard chat, the system searches for relevant memories based on your query and adds them to the AI's context.

Understanding Memory Types

We can think about agent memory in terms of its duration and purpose:

Working Memory (Temporary - During a response)

  • Purpose: This is akin to having a piece of scratch paper when working through a problem or completing multiple tasks simultaneously during a single response. It stores temporary, incremental states or outputs generated during a single task or a sequence of chained tasks within an agent's workflow.

  • How it Works: It holds intermediate results needed to compute the next step or the final outcome of an instruction. Once the response is sent, this memory is typically discarded.

Short-Term Memory (Session-Specific - During a Conversation)

  • Purpose: This refers to the context of an existing session or conversation the agent(s) are currently part of. It holds information that is relevant to that specific conversation.

  • How it Works: The system needs to recall this context very rapidly to maintain conversational flow and provide relevant, accurate responses within the ongoing interaction. It allows the agent to remember previous prompts and its own answers within the current chat.

  • Implementation: It uses a mix of chat summary, chat history, and Retrieval Augmented Generation (RAG) to find relevant messages (older than the history) in the same chat.

Long-Term Memory (Persistent - Across Sessions)

  • Purpose: This holds information that should be remembered for future interactions, even after the current session has concluded. It stores distilled knowledge, key attributes, and summaries from past experiences that inform the agent's behaviour over time.

  • How it Works: Creating long-term memory from working or short-term memory requires analysis to extract the key points or important attributes. The extract information is then stored as a memory. Relevant memories can then be supplied to the agent at the commencement of a new session or task to provide essential context or guidance.

  • Implementation: This is a dedicated system. It can be used to store various types of persistent information:

    • Constitutional Memories (Highest Priority - MUST be enforced): Fundamental rules, guidelines, and core preferences that shape the AI's fundamental behaviour and responses (unbreakable laws or directives). Examples: Preferred language, specific response formats, core ethical guidelines, naming conventions the AI must use.

    • User Personal Memories (High Priority - Should be enforced): User-specific information like preferences, characteristics, history, relationships, likes/dislikes, habits, and other personal circumstances provided by the user. Used to personalise interactions and maintain conversational continuity regarding the user's life.

    • AI Personal Memories (Medium Priority - Should be referenced for consistency): Define the AI's persona or background characteristics as instructed by the user (distinct from constitutional rules governing behaviour). Examples: A user-defined name, age, origin story, or personality traits for the AI assistant. Helps the AI maintain a consistent identity.

    • Other Important Memories (General Information - Can be referenced): Stores explicitly saved pieces of information that don't fall into the above categories. This includes facts the user specifically asked the AI to remember, generic information to retain, or details about people other than the primary user. Used for factual recall without interpretation.

Memory Priority and Enforcement

The system follows specific steps to ensure memories are used correctly, particularly for stored long-term memories:

  1. Check: Before forming a response, relevant constitutional memories are checked.

  2. Validate: The potential response is validated against these constitutional rules.

  3. Allow: The response is only sent if it satisfies all applicable constitutional rules.

Conflicts: When multiple relevant memories exist (excluding Constitutional, which always takes precedence), recency and relevance score matter. More recent memories and those with a lower score (indicating higher similarity/relevance to the query) are prioritised.

Beyond these types, systems with multiple agents also require memory management. Agents need to communicate with one another using mechanisms such as a shared session (potentially utilising short-term memory concepts). However, individual agents might also maintain their own session-specific information depending on the nature of the tasks they are undertaking. One might also opt to employ certain data privacy protocols to confine specific data within a particular assistant (e.g., keeping a credit card number within one agent) and then transmit only the de-identified information to subsequent tasks and assistants instead.

Viewing and Managing Memories

You can view and manage stored long-term memories through the "Memory" section accessible from the top navigation bar (via the "View Memory" button or potentially within the main menu), typically for standard chats.

  • Memory List: The main screen displays a list of memories. Each entry typically shows:

    • The core memory text.

    • Associated Topic and Keywords (if generated/added).

    • The date the memory was created or last updated.

    • A tag indicating the memory type (e.g., "memory", "constitution", etc.).

    • Action buttons (like edit or delete).

  • Search/Filtering: You can search for specific memories (the system uses semantic search to find relevant entries even if your query uses different wording) and potentially filter by type.

  • Adding/Editing: Memories can be added explicitly by asking the assistant to remember something specific ("Save as Memory" option on messages) or may be extracted automatically by the system from conversations (depending on configuration). You can typically edit or delete existing memories via the action buttons.

By effectively utilising these different memory types and management tools, AI agents can provide a highly personalised, context-aware, and reliable experience.

25 April 2025