PajamasWeb Logo
Core Concepts

Understanding Memory

Memory is what makes PJais personas truly intelligent. They remember your conversations, learn your preferences, and build context over time. Learn how the memory system works and how to manage it effectively.

Why Memory Matters

Without memory, every conversation would start from scratch. With memory, your personas become true assistants that understand your context, preferences, and history.

Continuity Across Conversations

Pick up where you left off. Your persona remembers previous discussions, so you don't have to repeat yourself or provide context every time.

Personalized Responses

Personas learn your preferences, communication style, and needs. Responses become more tailored and relevant over time.

Knowledge Accumulation

Build a knowledge base over time. Personas remember facts, decisions, and information you've shared, creating a growing repository of context.

Intelligent Retrieval

Semantic search finds relevant memories even if you don't use exact words. The system understands meaning, not just keywords.

How Memory Works

PJais uses a sophisticated multi-layered memory system inspired by how human memory works. Here's the process:

1
Conversation Storage
Every message is saved

When you have a conversation, every message (yours and the persona's) is stored in the local database with metadata like timestamp, token count, and conversation ID.

What gets stored:

  • • Full message text
  • • Timestamp and conversation ID
  • • Token count and model used
  • • Persona ID and configuration
2
Semantic Embedding
Understanding meaning

Each message is converted into a semantic embedding - a mathematical representation of its meaning. This allows the system to find related memories based on concepts, not just keywords.

Example:

If you previously discussed "machine learning models," the system can retrieve that memory when you ask about "AI algorithms" - even though the words are different, the concepts are related.

3
Fact Extraction
Identifying important information

The system analyzes conversations to extract key facts, preferences, and decisions. These are stored separately for quick retrieval.

Examples of extracted facts:

  • • "User prefers Python over JavaScript"
  • • "User's project deadline is March 15"
  • • "User works in healthcare industry"
  • • "User prefers concise explanations"
4
Memory Retrieval
Finding relevant context

When you send a new message, the system searches for relevant memories using semantic similarity. The most relevant memories are included in the context sent to the AI.

Retrieval process:

  1. Convert your message to semantic embedding
  2. Search for similar embeddings in memory
  3. Rank results by relevance and recency
  4. Include top results in AI context

Types of Memory

PJais uses three types of memory, each serving a different purpose:

Short-Term Memory (Working Memory)
Current conversation context

Short-term memory holds the current conversation. It's what the persona uses to maintain context within a single session.

Characteristics:

  • • Limited by context window size
  • • Cleared when conversation ends
  • • Fast access and retrieval
  • • Includes recent messages only

Best for:

  • • Following conversation flow
  • • Maintaining immediate context
  • • Quick back-and-forth exchanges
  • • Temporary information
Long-Term Memory (Persistent Memory)
Facts and knowledge that persist

Long-term memory stores important facts, preferences, and information across all conversations. This is what makes personas truly remember you.

Characteristics:

  • • Persists across conversations
  • • Searchable and retrievable
  • • Organized by importance
  • • Can be manually edited

Best for:

  • • User preferences and habits
  • • Important facts and decisions
  • • Project information
  • • Personal details
Semantic Memory (Conceptual Memory)
Understanding relationships and concepts

Semantic memory uses AI embeddings to understand the meaning and relationships between concepts. It finds relevant information even when exact words don't match.

Characteristics:

  • • Concept-based, not keyword-based
  • • Finds related information
  • • Understands context and meaning
  • • Improves over time

Best for:

  • • Finding related discussions
  • • Connecting ideas across conversations
  • • Discovering patterns
  • • Contextual understanding

Example:

You said before: "I'm building a web app with React"

You ask now: "What's the best state management solution?"

Semantic memory retrieves: The React conversation, even though you didn't mention React in your question, because it understands the context.

Memory Settings & Configuration

Fine-tune how memory works for each persona:

Memory Depth
How much history to remember

Controls how many past conversations are considered when retrieving memories.

Shallow (1-5 conversations)

Only recent conversations. Fast and efficient. Good for task-focused personas.

Medium (10-20 conversations)

Balanced approach. Remembers recent context plus important older information. Recommended for most use cases.

Deep (50+ conversations)

Extensive history. Best for long-term projects, tutors, or personas that need to track progress over time.

Context Window Size
How much to include in each request

The number of tokens (roughly words) to include in the AI's context. Larger windows provide more context but are slower and more expensive.

Small (2K-4K)

Fast, cheap. Good for simple Q&A.

Medium (4K-8K)

Balanced. Recommended for most uses.

Large (8K-32K)

Maximum context. For complex tasks.

Memory Retention
What to keep and what to forget

Configure what types of information should be retained:

  • FactsImportant information and preferences (always retained)
  • ConversationsFull conversation history (configurable retention period)
  • TemporarySession-only information (cleared after conversation)

Managing Memory

You have full control over what your personas remember:

View Memories

See what your persona has learned and stored:

  1. Open Persona Settings
  2. Go to Memory tab
  3. Click "View Memories"
  4. Browse facts, conversations, and embeddings
Add Memories Manually

Teach your persona specific facts:

  1. Go to Persona Settings → Memory
  2. Click "Add Memory"
  3. Enter the fact or information
  4. Set importance level (optional)
Delete Memories

Remove specific memories or clear all:

  • Individual: View memories and delete specific ones
  • Conversation: Delete entire conversation history
  • All: Clear all memories for a fresh start
Export & Backup

Save your memories for safekeeping:

  • Export as JSON for backup
  • Import memories from backup
  • Transfer between devices
  • Share with other personas (advanced)

Privacy & Storage

Where Memories Are Stored

All memories are stored locally on your device by default. They never leave your computer unless you enable cloud sync.

Windows

%APPDATA%/pjais/memory/

macOS

~/Library/Application Support/pjais/memory/

Linux

~/.config/pjais/memory/
Memory Encryption

Memories are encrypted at rest using industry-standard encryption:

  • AES-256 encryption for local storage
  • End-to-end encryption for cloud sync
  • Encryption keys derived from your password
  • No one can read your memories without your password
Learn More About Privacy
Memory Isolation

Each persona has completely isolated memory. Memories from one persona never leak into another. This ensures each persona maintains its unique context and role.

Memory Best Practices

1. Match Memory Depth to Purpose

Task-focused personas (code reviewer, translator) need less memory depth. Long-term assistants (tutor, coach, project manager) benefit from deeper memory to track progress over time.

2. Periodically Review Memories

Check what your persona has learned every few weeks. Remove outdated information and add important facts manually to ensure accuracy.

3. Use Incognito Mode for Temporary Chats

When you don't want a conversation saved to memory (testing, one-off questions, sensitive topics), use incognito mode. The conversation won't be stored.

4. Start Fresh When Context Changes

If you switch to a completely different project or topic, consider starting a new conversation or clearing old memories. This prevents confusion from mixed contexts.

5. Backup Important Memories

Export memories for personas with valuable accumulated knowledge. This protects against data loss and allows you to transfer knowledge to new personas if needed.

Common Questions

How much storage do memories use?

Memories are very efficient. A typical persona with hundreds of conversations uses only 10-50MB of storage. Embeddings are compressed, and only important information is retained long-term.

Can I transfer memories between personas?

Not directly, as memories are isolated by design. However, you can export memories from one persona and manually import selected facts into another. This is an advanced feature for specific use cases.

What happens to memories when I delete a persona?

All memories associated with that persona are deleted. Make sure to export any important information before deleting a persona. Deleted memories cannot be recovered.

Do memories sync across devices?

Yes, if you enable cloud sync. Memories are encrypted before syncing, so they remain private. You can choose to sync all memories or only specific personas.

Can the AI forget things?

Yes. If memory depth is set low, older conversations may not be retrieved. You can also manually delete memories. Additionally, if context window is full, some older context may be truncated.

Next Steps

Understanding Personas
How personas use memory

Learn how personas combine memory with system prompts and configuration.

Learn About Personas
Advanced Memory Features
Power user techniques

Explore advanced memory visualization, search, and management features.

Advanced Features
Privacy & Security
How your data is protected

Understand how PJais keeps your memories private and secure.

Privacy Guide
Backup & Export
Protect your data

Learn how to backup, export, and manage your conversation data.

Export Guide