Skip to main content
This guide covers every section of the MACA config in detail, with practical recipes for common use cases.

Understanding the Config Structure

A MACA configuration has three top-level sections: storage, ingestion, and retrieval. Here is a fully annotated example:
maca-config.yaml
# ============================================================
# MACA Configuration — Memory Architecture Configuration Artifact
# ============================================================
# Version: 1.0.0
# Instance: inst_a1b2c3d4e5f67890
# ============================================================

version: "1.0.0"

# --- Storage: Where and how memories are persisted ---
storage:
  vector:
    namespace: "prod-memories"          # Logical partition in the vector store
    embedding_dimension: 1536           # Must match your embedding model (1536 = OpenAI)
    enabled: true                       # Set false to disable vector storage entirely
  graph:
    namespace: "prod-knowledge"         # Logical partition in the graph store
    enabled: true                       # Set false to disable graph/entity storage
  scoping:
    primary_scope: "user"               # user | customer | instance
  retention:
    max_memory_age_days: 365            # Memories older than this are auto-purged (0 = no limit)

# --- Ingestion: What gets extracted from incoming content ---
ingestion:
  categories:
    facts: true                         # Factual statements about users/topics
    preferences: true                   # User likes, dislikes, choices
    temporal_events: true               # Time-bound events and plans
    relationships: true                 # Connections between entities
    procedures: false                   # Step-by-step instructions (off by default)
    emotions: false                     # Emotional states and sentiment
  extraction:
    mode: "standard"                    # standard | enhanced
    confidence_threshold: 0.7           # 0.0-1.0 — minimum confidence to persist a memory
  chunking:
    strategy: "semantic"                # semantic | fixed
    max_chunk_tokens: 512               # Maximum tokens per chunk
  pii:
    handling: "redact"                  # redact | mask | passthrough
    categories: ["email", "phone", "ssn", "credit_card"]
  agent_hints:
    - "Focus on extracting product preferences and purchase history"
    - "Treat project deadlines as high-priority temporal events"

# --- Retrieval: How memories are searched and ranked ---
retrieval:
  modes:
    fast: true                          # ~50-100ms, vector-only search
    accurate: true                      # ~200-500ms, vector + graph + re-ranking
  ranking:
    recency_weight: 0.3                 # 0.0-1.0 — how much to favor recent memories
    relevance_weight: 0.5               # 0.0-1.0 — how much to favor semantic match
    confidence_weight: 0.2              # 0.0-1.0 — how much to favor high-confidence memories
  anticipation:
    enabled: false                      # Predictive pre-fetch for common query patterns
    cache_ttl_seconds: 300              # How long anticipated results stay cached
  context_budget:
    max_tokens: 4096                    # Maximum tokens returned in a single retrieval
  agent_hints:
    - "Prioritize the user's most recent preferences over older ones"
    - "Include relationship context when entities are mentioned"
The version field is required. Synap uses it to track config history and enable rollback. Always increment the version when making changes.

Storage Configuration

The storage section controls where memories are persisted and how they are organized.

Vector Store

The vector store powers semantic search — finding memories that are conceptually similar to a query, even if they do not share exact keywords.
storage:
  vector:
    namespace: "prod-memories"
    embedding_dimension: 1536
    enabled: true
ParameterDescriptionDefault
namespaceLogical partition name. Use different namespaces for different environments (e.g., dev-memories, staging-memories, prod-memories)."default"
embedding_dimensionMust match your embedding model. Common values: 1536 (OpenAI text-embedding-ada-002/3-small), 768 (Cohere), 384 (MiniLM).1536
enabledSet to false to disable vector storage entirely. Retrieval will rely on graph-only queries.true
Changing embedding_dimension on an existing instance does not re-embed existing memories. If you switch embedding models, you will need to re-index. See the Migration Guide for details.

Graph Store

The graph store maintains a knowledge graph of entities and their relationships. It powers entity resolution, relationship queries, and structured lookups.
storage:
  graph:
    namespace: "prod-knowledge"
    enabled: true
ParameterDescriptionDefault
namespaceLogical partition for the graph store."default"
enabledSet to false to disable graph storage. Entity resolution and relationship extraction will be skipped.true
For most applications, keep both vector and graph stores enabled. The combination of semantic search (vector) and structured queries (graph) produces significantly better retrieval results than either alone.

Scoping

Scoping determines the default isolation boundary for memories. This controls how memories are organized and who can access them.
storage:
  scoping:
    primary_scope: "user"
ValueDescriptionBest For
"user"Each user gets an isolated memory space. The most common setting.Multi-user applications, chatbots, personal assistants
"customer"Memories are shared across all users within a customer (organization).Team-based tools, enterprise apps with shared context
"instance"All memories are shared across the entire instance.Single-user agents, knowledge bases, internal tools
See the Multi-User Scoping Guide for a detailed explanation of scope hierarchy and isolation patterns.

Retention

Retention controls how long memories are kept before automatic cleanup.
storage:
  retention:
    max_memory_age_days: 365
ParameterDescriptionDefault
max_memory_age_daysMemories older than this threshold are automatically purged during the nightly cleanup cycle. Set to 0 to disable automatic purging.0 (no limit)
Consider your use case carefully when setting retention:
  • Customer support: 90-180 days is usually sufficient. Older tickets lose relevance.
  • Personal assistant: 365+ days. Users expect long-term memory.
  • Compliance-sensitive: Match your data retention policy. Consult your legal team.
  • High-volume analytics: 30-90 days to control storage costs.

Ingestion Configuration

The ingestion section controls what the pipeline extracts from incoming documents and how content is processed.

Categories

Categories define which types of knowledge Synap extracts. Each category can be independently enabled or disabled.
ingestion:
  categories:
    facts: true
    preferences: true
    temporal_events: true
    relationships: true
    procedures: false
    emotions: false
CategoryWhat It ExtractsExample
factsFactual statements about users, topics, or the world”User works at Acme Corp as a software engineer”
preferencesLikes, dislikes, choices, and stated preferences”User prefers dark mode and concise responses”
temporal_eventsTime-bound events, deadlines, plans, and schedules”User has a dentist appointment next Tuesday”
relationshipsConnections between entities (people, organizations, concepts)“Alice manages the engineering team at Acme”
proceduresStep-by-step instructions and workflows”To deploy, run tests first, then build, then push”
emotionsEmotional states, sentiment, and tone”User expressed frustration about the billing issue”
Start with facts and preferences enabled. These two categories deliver the most value for conversational AI. Add temporal_events if your application involves scheduling or planning. Enable relationships when entity connections matter (e.g., CRM, team management).

Extraction

Extraction settings control the quality and aggressiveness of the extraction pipeline.
ingestion:
  extraction:
    mode: "standard"
    confidence_threshold: 0.7
ParameterDescriptionDefault
mode"standard" — balanced speed and accuracy. "enhanced" — deeper extraction with multi-pass analysis (slower, higher quality)."standard"
confidence_thresholdMinimum confidence score (0.0-1.0) required to persist an extracted memory. Higher values mean fewer but more reliable memories.0.7
Tuning the confidence threshold:
ThresholdEffectUse When
0.5More permissive — captures more memories, including lower-confidence onesRecall is more important than precision (e.g., research, brainstorming)
0.7Balanced default — good tradeoff between coverage and qualityMost applications
0.9Very strict — only high-confidence memories are storedPrecision is critical (e.g., medical, legal, financial)

Chunking

Chunking determines how documents are split before embedding and storage.
ingestion:
  chunking:
    strategy: "semantic"
    max_chunk_tokens: 512
StrategyDescriptionBest For
"semantic"Splits at natural boundaries (paragraphs, topic shifts). Produces higher-quality embeddings.Conversations, articles, documents
"fixed"Splits at fixed token intervals. Faster but may cut across ideas.Structured data, logs, uniform-format content

PII Handling

Controls how Personally Identifiable Information is handled during ingestion.
ingestion:
  pii:
    handling: "redact"
    categories: ["email", "phone", "ssn", "credit_card"]
Handling ModeDescription
"redact"PII is detected and permanently removed before storage. Original content cannot be recovered.
"mask"PII is replaced with tokens (e.g., [EMAIL], [PHONE]). The mapping is stored separately for authorized unmasking.
"passthrough"No PII processing. Content is stored as-is. Use only when you handle PII externally.
If your application handles user data subject to GDPR, CCPA, or similar regulations, do not use "passthrough". Use "redact" or "mask" and ensure your retention policy complies with applicable data protection requirements.

Agent Hints

Agent hints are natural-language instructions that guide the extraction pipeline. They help Synap understand domain-specific context that the general-purpose pipeline might miss.
ingestion:
  agent_hints:
    - "Focus on extracting product preferences and purchase history"
    - "Treat project deadlines as high-priority temporal events"
    - "When users mention team members, extract the reporting relationship"
Agent hints are powerful for domain-specific tuning. Write them as clear, specific instructions. Avoid vague hints like “extract everything important” — instead, name the specific types of information that matter for your use case.

Retrieval Configuration

The retrieval section controls how memories are searched, ranked, and delivered.

Modes

Synap supports two retrieval modes. You can enable one or both.
retrieval:
  modes:
    fast: true
    accurate: true
ModeLatencyMethodBest For
fast~50-100msVector-only semantic searchReal-time chat, interactive UIs, latency-sensitive paths
accurate~200-500msVector + graph search with cross-encoder re-rankingComplex queries, research, cases where precision outweighs speed
When both modes are enabled, the SDK selects the mode via the mode parameter in context.fetch():
# Fast mode for real-time chat
context = await sdk.conversation.context.fetch(
    conversation_id="conv_789",
    search_query=["user preferences"],
    mode="fast"
)

# Accurate mode for a detailed research query
context = await sdk.conversation.context.fetch(
    conversation_id="conv_789",
    search_query=["all interactions with Acme Corp in Q3"],
    mode="accurate"
)

Ranking

Ranking weights control how retrieved memories are scored and ordered. All three weights should be between 0.0 and 1.0. They do not need to sum to 1.0 — they are normalized internally.
retrieval:
  ranking:
    recency_weight: 0.3
    relevance_weight: 0.5
    confidence_weight: 0.2
SignalDescriptionIncrease When
recency_weightFavors recently created/updated memoriesUser context changes frequently, recent info is more valuable
relevance_weightFavors memories semantically closest to the search queryQuery accuracy matters most, user history is stable
confidence_weightFavors memories with higher extraction confidence scoresOperating in high-stakes domains where accuracy is critical
A good starting point for most applications is relevance: 0.5, recency: 0.3, confidence: 0.2. This prioritizes relevance while giving a moderate boost to recent memories and a light preference for high-confidence extractions. Tune from there based on your retrieval quality observations.

Anticipation

Anticipation enables predictive pre-fetching of context for common query patterns. When enabled, Synap analyzes retrieval patterns and pre-caches likely-needed context before the SDK requests it.
retrieval:
  anticipation:
    enabled: false
    cache_ttl_seconds: 300
ParameterDescriptionDefault
enabledTurn predictive pre-fetch on or off.false
cache_ttl_secondsHow long anticipated results stay in the pre-fetch cache.300 (5 minutes)
Anticipation adds a small amount of background processing and storage overhead. Enable it when you observe repetitive retrieval patterns (e.g., a support bot that frequently looks up the same customer context). For applications with highly diverse queries, the hit rate may be too low to justify the overhead.

Context Budget

The context budget controls the maximum volume of content returned in a single retrieval call.
retrieval:
  context_budget:
    max_tokens: 4096
ParameterDescriptionDefault
max_tokensMaximum number of tokens across all returned memories. Synap truncates and prioritizes to stay within budget.4096
Align max_tokens with your LLM’s context window:
LLM Context WindowRecommended max_tokensReasoning
4K tokens1024-1536Leave room for system prompt + user message + response
8K tokens2048-3072Comfortable budget for most conversations
32K+ tokens4096-8192Generous context, but more is not always better
Setting max_tokens too high can flood your LLM prompt with marginally relevant context, reducing response quality. Start conservative and increase only if you observe retrieval misses.

Agent Hints (Retrieval)

Similar to ingestion hints, retrieval agent hints guide how Synap ranks and filters results.
retrieval:
  agent_hints:
    - "Prioritize the user's most recent preferences over older ones"
    - "Include relationship context when entities are mentioned"
    - "Deprioritize procedural memories unless the user asks 'how to'"

Common Configuration Recipes

These are battle-tested configurations for common application patterns.
High recall, user-scoped, all core categories enabled. Optimized for quickly retrieving a customer’s full context during a support interaction.
customer-support-maca.yaml
version: "1.0.0"

storage:
  vector:
    namespace: "support-memories"
    embedding_dimension: 1536
    enabled: true
  graph:
    namespace: "support-knowledge"
    enabled: true
  scoping:
    primary_scope: "user"
  retention:
    max_memory_age_days: 180

ingestion:
  categories:
    facts: true
    preferences: true
    temporal_events: true
    relationships: true
    procedures: false
    emotions: true            # Track frustration/satisfaction for escalation
  extraction:
    mode: "standard"
    confidence_threshold: 0.6  # Lower threshold for broader recall
  chunking:
    strategy: "semantic"
    max_chunk_tokens: 512
  pii:
    handling: "mask"
    categories: ["email", "phone", "ssn", "credit_card"]
  agent_hints:
    - "Extract product names, order IDs, and issue descriptions as facts"
    - "Track customer sentiment and frustration level"
    - "Note any escalation requests or supervisor mentions"

retrieval:
  modes:
    fast: true
    accurate: true
  ranking:
    recency_weight: 0.4       # Recent interactions matter most in support
    relevance_weight: 0.4
    confidence_weight: 0.2
  anticipation:
    enabled: true             # Support queries are repetitive
    cache_ttl_seconds: 600
  context_budget:
    max_tokens: 3072
  agent_hints:
    - "Always include the customer's most recent open issue"
    - "Include past resolution history for similar problems"

Applying Changes Safely

Configuration changes can have significant impact on how your instance processes and retrieves memories. Always follow this workflow:
1

Write Your Config

Create or modify your MACA YAML file locally. Validate the YAML syntax before proceeding.
2

Dry Run

Submit the configuration with the dry-run flag to validate without applying:
result = await admin_client.config.validate(
    instance_id="inst_a1b2c3d4e5f67890",
    config_yaml=open("maca-config.yaml").read(),
    dry_run=True
)

print(f"Valid: {result.valid}")
print(f"Warnings: {result.warnings}")
print(f"Changes: {result.diff}")
The dry run performs schema validation, business rule checks, and generates a diff showing exactly what will change.
3

Review the Diff

Examine the diff carefully. Pay particular attention to:
  • Categories being disabled (extraction will stop for that type)
  • Scope changes (may affect retrieval behavior)
  • Retention changes (may trigger cleanup of older memories)
  • Embedding dimension changes (requires re-indexing)
4

Apply the Config

Once satisfied, apply the configuration:
result = await admin_client.config.apply(
    instance_id="inst_a1b2c3d4e5f67890",
    config_yaml=open("maca-config.yaml").read()
)

print(f"Applied version: {result.version}")
print(f"Status: {result.status}")
5

Monitor

After applying, monitor your instance in the Dashboard for any unexpected behavior. Check:
  • Ingestion success rate
  • Memory extraction counts by category
  • Retrieval latency
  • Error rates
Configuration changes affect new requests only. Existing memories are not re-processed, re-extracted, or re-embedded when you change the config. If you need to re-process existing content (e.g., after adding a new category), you must re-ingest the source documents.

Rolling Back

If a config change causes issues, roll back to a previous version:
# List config history
history = await admin_client.config.list_versions(
    instance_id="inst_a1b2c3d4e5f67890"
)

for version in history:
    print(f"v{version.version}{version.applied_at}{version.status}")

# Roll back to a specific version
result = await admin_client.config.rollback(
    instance_id="inst_a1b2c3d4e5f67890",
    target_version=2
)
Document your rollback plan before applying any config change, especially in production. Know which version you will roll back to and what the impact will be.

Next Steps

Multi-User Scoping

Learn how to configure memory isolation for multi-tenant applications.

Memory Architecture Concepts

Understand the underlying architecture that MACA configs control.

Entities and Resolution

Learn how entity resolution works with your graph store configuration.

Production Checklist

Ensure your configuration is production-ready.