Skip to main content

What is Shared Memory?

Shared Memory is a persistent storage system that maintains information accessible to multiple users across all interactions with their digital twins. Unlike User Memory (which is private to each individual), Shared Memory creates a common knowledge base that can be leveraged by teams, departments, or entire organizations.

Collaborative Storage

Centralized information bank accessible across teams and organizations

Persistent & Scalable

Data persists across all users, sessions, and digital twins indefinitely

Secure & Controlled

Access controls determine who can read, write, or manage shared parameters

Namespace Organization

Structured categorization enables efficient retrieval and management

Technical Architecture

Storage Model

Shared Memory uses a key-value storage architecture organized by namespaces:
namespace/key_name → {
  value: "stored data",
  description: "purpose and context",
  created: timestamp,
  shared: true
}
Key Components:
  • Namespace: Logical grouping for related parameters (e.g., company_standards, technical_stack)
  • Key Name: Unique identifier within namespace
  • Value: The stored data (strings, numbers, JSON objects)
  • Description: Metadata explaining purpose and usage
  • Shared Flag: Boolean indicating shared vs. user-private storage

Access Patterns

  • Read Operations
  • Write Operations
  • Delete Operations
Retrieval Methods:
  • Search by namespace: get_from_memory("company_standards", "true")
  • Search by keyword: get_from_memory("typescript", "true")
  • Retrieve all: get_from_memory("", "true")
Performance:
  • Token-based search with case-insensitive matching
  • Returns CSV format to lower token usage: namespace,key,value,description,shared,created
  • Efficient for both targeted and broad queries

Technical Benefits

Performance & Scalability

Minimal Latency Access

Shared parameters are saved and retreived locally during conversations to minimize latency

Scalability

Supports thousands of parameters without performance degradation

Efficient Retrieval

Token-based search enables fast lookups across large parameter sets

Batch Operations

Store or retrieve multiple parameters in single operations

Data Consistency

Single Source of Truth

Eliminates data duplication and conflicting information across users

Atomic Updates

Changes propagate immediately to all users of you digital twin

Version Control

Timestamp tracking enables audit trails and change history

Integration Capabilities

Assistant Integration

Use set_in_memory and get_from_memory tools in Assistant instructions

API Access

Programmatic access through memory management tools

Namespace Isolation

Logical separation prevents cross-contamination of different data domains

Flexible Schema

Store any data type—strings, numbers, JSON objects, arrays

Use Cases

Development Teams

Store technical standards that all developers reference:
{
  "namespace": "technical_stack",
  "parameters": [
    {
      "key_name": "primary_language",
      "key_value": "TypeScript",
      "key_description": "Primary language for all new projects"
    },
    {
      "key_name": "react_version",
      "key_value": "18.x",
      "key_description": "Approved React version"
    },
    {
      "key_name": "code_review_approvals",
      "key_value": "2",
      "key_description": "Minimum approvals required before merge"
    }
  ]
}
Benefits:
  • Consistent tooling and framework versions across projects
  • Automated enforcement through Assistant integration
  • Reduced onboarding time for new developers

Enterprise Organizations

Maintain compliance and security standards:
{
  "namespace": "compliance_rules",
  "parameters": [
    {
      "key_name": "data_encryption",
      "key_value": "AES-256",
      "key_description": "Required encryption standard for data at rest"
    },
    {
      "key_name": "api_rate_limits",
      "key_value": "true",
      "key_description": "All APIs must include rate limit headers"
    },
    {
      "key_name": "mfa_requirement",
      "key_value": "production_access",
      "key_description": "MFA required for production system access"
    }
  ]
}
Benefits:
  • Automated compliance checking across all user interactions
  • Audit trail for regulatory requirements
  • Consistent security posture organization-wide

Documentation Teams

Standardize writing conventions and templates:
{
  "namespace": "documentation_standards",
  "parameters": [
    {
      "key_name": "api_spec_format",
      "key_value": "OpenAPI 3.0",
      "key_description": "Standard format for API documentation"
    },
    {
      "key_name": "tone_external",
      "key_value": "professional, helpful, concise",
      "key_description": "Brand voice for customer-facing content"
    },
    {
      "key_name": "code_comment_style",
      "key_value": "JSDoc",
      "key_description": "Required format for code documentation"
    }
  ]
}
Benefits:
  • Consistent documentation quality across teams
  • Automated style checking through Assistants
  • Reduced editorial review time

Implementation Guide

Setting Up Shared Memory

1

Identify Critical Standards

Determine which organizational knowledge should be centralized (compliance rules, technical standards, templates)
2

Design Namespace Structure

Create logical categories that reflect your organizational structure:
  • company_standards - Organization-wide policies
  • technical_stack - Approved technologies and patterns
  • compliance_rules - Regulatory requirements
  • project_templates - Standard formats and structures
3

Populate Initial Parameters

Store foundational standards using natural language or Assistant instructions:
"Store in shared memory under technical_stack: 
Our primary language is TypeScript, 
we use React 18.x for frontend, 
and require 2 code review approvals before merge"
4

Configure Access Controls

Define who can read, write, and manage shared parameters based on organizational roles
5

Integrate with Assistants

Update Assistant instructions to reference shared memory for automated enforcement

Assistant Integration

Example: Code Review Assistant
You are a Code Review Assistant that enforces company standards.

Before reviewing code:
1. Retrieve technical standards: get_from_memory("technical_stack", "true")
2. Retrieve compliance rules: get_from_memory("compliance_rules", "true")
3. Check code against stored standards
4. Flag violations and suggest corrections

Always reference shared memory for:
- Language and framework versions
- Coding conventions and style guides
- Security requirements
- Documentation standards
Example: Documentation Assistant
You are a Documentation Assistant that maintains consistent writing standards.

When creating documentation:
1. Retrieve documentation standards: get_from_memory("documentation_standards", "true")
2. Apply stored tone, format, and style guidelines
3. Use approved templates from shared memory
4. Ensure compliance with brand voice

Store new templates using:
set_in_memory([{
  key_name: "api_doc_template",
  key_value: "template content",
  key_description: "Standard API documentation format",
  key_namespace: "project_templates"
}], "true", "false")

Managing Shared Memory

Viewing Parameters

Natural Language Queries:
"Show all shared memory parameters"
"What's stored in the technical_stack shared namespace?"
"Display shared memory in JSON format"
"Search shared memory for TypeScript standards"
View Shared Memory Parameters
Statistics are returned alongside the parameters and used by the Memory Optimizer assistant
Tool-Based Retrieval:
// Get all shared parameters
get_from_memory("", "true")

// Search by namespace
get_from_memory("company_standards", "true")

// Search by keyword
get_from_memory("typescript", "true")

Adding/Updating Parameters

Natural Language:
"Store in shared memory under technical_stack: 
We use Node.js 17 with ESM modules"

"Update shared memory: Change React version to 18.2"

"Add to compliance_rules: All APIs require authentication"
Add to Shared Memory
Review the structure of the parameters saved into the shared memory in the Agent Details
Tool-Based Storage:
set_in_memory([
  {
    key_name: "node_version",
    key_value: "17",
    key_description: "Required Node.js version",
    key_namespace: "technical_stack"
  },
  {
    key_name: "module_system",
    key_value: "ESM",
    key_description: "Use ES modules, not CommonJS",
    key_namespace: "technical_stack"
  }
], "true", "false")

Namespace Organization

Best Practices:

Hierarchical Structure

Use descriptive namespaces that reflect organizational domains:
  • company_standards/technical
  • company_standards/security
  • team_preferences/frontend
  • team_preferences/backend

Clear Descriptions

Include detailed descriptions explaining:
  • Purpose of the parameter
  • When it applies
  • Who should reference it
  • Related parameters

Consistent Naming

Use clear, descriptive key names:
  • primary_language not lang
  • code_review_approvals not approvals
  • api_rate_limit_enabled not rate_limit

Regular Maintenance

Schedule periodic reviews to:
  • Remove outdated parameters
  • Update evolving standards
  • Consolidate duplicate information

Shared Memory vs. User Memory

User Memory

Private Storage
  • Accessible only to individual user
  • Stores personal preferences and context
  • User has full control
  • Typically overrides shared memory for preferences
Use Cases:
  • Learning style preferences
  • Individual project context
  • Personal communication style
  • Private notes and reminders

Shared Memory

Collaborative Storage
  • Accessible to multiple authorized users
  • Stores organizational standards and knowledge
  • Managed by administrators/team leads
  • Can enforce mandatory standards
Use Cases:
  • Company policies and compliance
  • Technical standards and patterns
  • Shared templates and workflows
  • Organizational knowledge base

Advanced Features

Conditional Logic

Store context-dependent standards:
{
  "namespace": "conditional_standards",
  "parameters": [
    {
      "key_name": "tone_customer_facing",
      "key_value": "professional, helpful",
      "key_description": "Tone for external communications"
    },
    {
      "key_name": "tone_internal",
      "key_value": "casual, collaborative",
      "key_description": "Tone for internal communications"
    }
  ]
}

Temporal Parameters

Include time-sensitive information:
{
  "namespace": "temporal_policies",
  "parameters": [
    {
      "key_name": "q4_2025_priority",
      "key_value": "mobile_app_development",
      "key_description": "Q4 2025 organizational focus area"
    },
    {
      "key_name": "migration_deadline",
      "key_value": "2025-03-31",
      "key_description": "AWS migration completion date"
    }
  ]
}

Batch Operations

Efficiently manage multiple parameters:
// Store multiple related parameters
set_in_memory([
  {key_name: "lang", key_value: "TypeScript", key_namespace: "tech_stack"},
  {key_name: "framework", key_value: "React 18", key_namespace: "tech_stack"},
  {key_name: "testing", key_value: "Jest + RTL", key_namespace: "tech_stack"},
  {key_name: "linting", key_value: "ESLint + Prettier", key_namespace: "tech_stack"}
], "true", "false")

Best Practices

1

Start with Critical Standards

Prioritize mandatory policies, compliance requirements, and security protocols that must be universally followed
2

Use Descriptive Namespaces

Organize parameters into logical categories that reflect your organizational structure and workflows
3

Document Thoroughly

Include detailed descriptions explaining purpose, context, and applicability of each parameter
4

Maintain Regularly

Review the shared memory to remove outdated information and update evolving values
5

Balance Control and Flexibility

Enforce mandatory standards strictly while allowing teams flexibility on non-critical preferences
6

Integrate with Assistants

Leverage memory tools in Assistant instructions for automated enforcement and consistency

Troubleshooting

Parameter Not Found

Symptoms: get_from_memory returns no results Solutions:
  • Verify namespace spelling
  • Check shared flag is set to “true”
  • Confirm parameter exists using broader search
  • Verify access permissions

Conflicting Values

Symptoms: Users receive contradictory guidance Solutions:
  • Review priority hierarchy
  • Mark mandatory standards explicitly
  • Consolidate duplicate parameters
  • Use conditional logic for context-dependent rules

Outdated Information

Symptoms: References to deprecated tools or old policies Solutions:
  • Schedule regular audits
  • Implement change notification system
  • Archive historical parameters
  • Update Assistant instructions

Performance Issues

Symptoms: Slow retrieval or excessive token usage Solutions:
  • Use targeted namespace searches
  • Avoid retrieving all parameters unnecessarily
  • Consolidate related parameters
  • Archive unused historical data

Summary

Shared Memory provides a scalable, persistent storage system that enables organizations to maintain consistent knowledge across all users and digital twins. By centralizing critical standards, policies, and organizational knowledge, teams achieve:
  • Zero-latency access to organizational standards
  • Automated enforcement through Assistant integration
  • Consistent quality across all user interactions
  • Scalable knowledge management without performance degradation
Next Steps:
  • Identify your organization’s critical standards to centralize
  • Design a namespace structure that reflects your organizational domains
  • Populate initial parameters using natural language or tools
  • Integrate shared memory with custom Assistants for automated enforcement
  • Schedule regular maintenance to keep shared memory current and relevant
I