Skip to content

Configuration

LivingMemory defaults work for most users. The settings you usually need to touch are model providers, recall size, memory isolation, graph retrieval, backup, and cleanup.

ScenarioRecommendation
First-time setupConfigure only provider_settings.llm_provider_id and provider_settings.embedding_provider_id; keep the rest at defaults
Private long-term assistantKeep persona and session filtering enabled; keep summary_trigger_rounds around 8-12
Group companionEnable session_manager.enable_full_group_capture and consider a larger context_window_size
Low-resource serverReduce index_rebuild_settings.embedding_batch_size, keep tasks_limit = 1, and increase request delays
Higher recall qualityKeep graph memory and atomization enabled; set recall_engine.top_k to 5-8
Cost-sensitive setupLower top_k, disable recent-context expansion, and increase summary trigger rounds

Model providers

KeyDefaultDescription
provider_settings.embedding_provider_idemptyGenerates memory vectors. Empty means AstrBot's default embedding provider
provider_settings.llm_provider_idemptySummarizes conversations and evaluates memory importance. Empty means AstrBot's default LLM

Try to keep the embedding model stable. If you change it and old memories recall poorly, run /lmem rebuild-index.

Session management

KeyDefaultDescription
session_manager.enable_full_group_capturetrueCaptures group messages that do not directly mention the bot
session_manager.context_window_size50Historical message window used for summarization and context analysis
session_manager.max_messages_per_session1000Maximum stored messages for one session
session_manager.cleanup_batch_size50Number of old summarized messages cleaned per batch

For very busy group chats, lower context_window_size or disable full group capture.

Recall and injection

KeyDefaultDescription
recall_engine.top_k5Number of memories automatically recalled each turn
recall_engine.max_k10Maximum results returned by active agent recall
recall_engine.importance_weight1.0Importance weight in final ranking
recall_engine.fallback_to_vectortrueFalls back to vector search if hybrid retrieval fails
recall_engine.injection_methodextra_user_contentWhere or how recalled memories are injected
recall_engine.inject_with_recent_contextfalseExpands the query with recent conversation
recall_engine.search_cache_enabledtrueEnables short-term retrieval caching

extra_user_content is the safest default. Gemini providers automatically fall back from fake_tool_call to extra_user_content. DeepSeek V4 thinking mode can now use normal fake_tool_call on recent AstrBot versions; the legacy fake_tool_call_deepseek_v4 option is kept only as a compatibility alias and automatically falls back to fake_tool_call.

Memory isolation

KeyDefaultDescription
filtering_settings.use_persona_filteringtrueOnly recall memories for the current persona
filtering_settings.use_session_filteringtrueOnly recall memories for the current session

Disable session filtering only if you intentionally want different chats to share one long-term memory pool. Keep persona filtering enabled when the bot has distinct personas.

Reflection and lifecycle

KeyDefaultDescription
reflection_engine.summary_trigger_rounds10Number of conversation rounds before summarization
importance_decay.decay_rate0.01Daily importance decay
importance_decay.access_decay_window_days30.0Time window for access reinforcement
importance_decay.access_decay_max_count10Maximum access reinforcement count

Lower summary_trigger_rounds if you want the bot to remember faster. Raise it if you want fewer LLM calls.

Agent tools

KeyDefaultDescription
agent_tools.enable_recall_tooltrueRegisters recall_long_term_memory for active recall
agent_tools.enable_memorize_toolfalseRegisters memorize_long_term_memory for active writes

The write tool is powerful and depends on model discipline. Start with active recall, then enable active writes after observing stable behavior.

Graph memory and atomization

KeyDefaultDescription
graph_memory.enabledtrueEnables graph-route retrieval
graph_memory.document_route_weight0.65Document-route weight
graph_memory.graph_route_weight0.35Graph-route weight
graph_memory.cross_route_bonus0.08Bonus when both routes hit the same memory
graph_memory.expansion_hops1Graph neighbor expansion hops
graph_memory.dynamic_route_weightingtrueAdjusts route weights based on query intent
graph_memory.atom_enabledtrueEnables memory atomization

For relationship-heavy use, increase graph-route weight or set expansion_hops to 2. If the database is large, second-hop expansion adds query cost, so use the WebUI recall debugger to inspect results first.

Backup, migration, and cleanup

KeyDefaultDescription
migration_settings.auto_migratetrueMigrates old databases at startup
migration_settings.create_backuptrueCreates a backup before migration
backup_settings.enabledtrueDaily database backup
backup_settings.keep_days7Backup retention days
forgetting_agent.auto_cleanup_enabledtrueDaily cleanup for old low-importance memories
forgetting_agent.cleanup_days_threshold30Age threshold for cleanup candidates
forgetting_agent.cleanup_importance_threshold0.3Importance threshold for cleanup candidates

For production use, keep backups and migration backups enabled. To make cleanup more conservative, raise the day threshold or lower the importance threshold.

Index rebuild tuning

KeyDefaultDescription
index_rebuild_settings.batch_size50Memories read per batch
index_rebuild_settings.embedding_batch_size8Texts per embedding request
index_rebuild_settings.tasks_limit1Embedding concurrency limit
index_rebuild_settings.max_retries5Retry count for a failed batch
index_rebuild_settings.request_delay5.0Delay between embedding requests
index_rebuild_settings.max_failure_ratio0.02Allowed failure ratio

If you hit API rate limits, increase request_delay first, then lower embedding_batch_size. Avoid raising concurrency blindly; index rebuilds are more about finishing reliably than finishing aggressively.