← Về thư mục
📄 / / projects / personal / Vedic-astro-mar / docs / BRAIN_GUIDE.md

🧠 Lob Brain & 4-Doc Rule: Unified Memory Guide

This guide explains how to use the Lob Brain (AI Memory Engine) in harmony with the 4-Doc Rule (V-Sync Logger) to ensure your project context never decays and your AI assistant remains perfectly aligned with your goals.


🏗️ The Dual-Layer Memory Model

We use a two-layer approach to maintain "Infinite Memory":

Layer System Tooling Purpose
1. Human Truth 4-Doc Rule v-sync-logger High-level, stable, readable Markdown docs (PROJECT_STATUS, CHANGELOG, APP_CONTEXT, README).
2. AI Subconscious Lob Brain brain_* MCP Tools Granular technical details, reasoning trails, and raw data segments with automatic λ-decay.

⚡ Automated Synchronization (End of Session)

The /v-sync-logger workflow is now automated to feed both layers. When you run a sync, the following happens:

  1. Docs Updated: PROJECT_STATUS.md and CHANGELOG.md are updated with your session's progress.
  2. Brain Ingested: The session summary is automatically stored in the Lob Brain via brain_store.
  3. Git Checkpoint: A Pulse commit is created (e.g., git commit -m "Pulse: Sync 2026-04-02").

[!TIP] Run /v-sync-logger at the end of every task. It's your "Save Game" button for the entire project state.


🔍 Context Retrieval (The "How-To")

When starting a new task, you don't need to re-explain everything. You can "call context" from the brain.

1. Querying Specific Logic

If you need to remember how a specific calculation or interpretation was decided: - Tool: brain_query - Example Usage:

"Find all brain entries regarding Sarvastakavarga (SAV) interpretation logic." - Internal Action: Searches the SQLite FTS5 index for relevant technical snippets stored in previous sessions.

2. Assembling Task Context

If you are moving to a new file and want the AI to be "warmed up" with the most relevant memories: - Tool: brain_context - Example Usage:

"Assemble a context block for the DashaService implementation based on our recent discussions." - Benefit: This uses λ-decay. It prioritizes 🔥 HOT (recent/important) memories over 🧊 COOL ones, ensuring the AI gets the most "flavorful" context without hitting token limits.


🕉️ Vedic Astrology Example

Scenario: Implementing Dasha Synthesis

Imagine you discussed the mathematical weights for Dasha interpretation three days ago, but it's not in the high-level APP_CONTEXT.md yet.

How to get help: 1. Ask Antigravity: "Query the brain for the Dasha weighting logic we discussed." 2. Receive: The AI retrieves the exact reasoning trail or YAML/JSON structure you saved earlier. 3. Action: "Based on those weights, update src/services/dashaService.ts."


🛠️ Maintenance & Pruning

Lob Brain uses the λ-Decay Algorithm ($Score = Importance \times e^{-\lambda \cdot \Delta t}$).


🚀 Quick Commands


[!IMPORTANT] Always mention its name: If you want the AI to specifically look into its long-term memory, say "Check the brain" or "Look in the Lob Brain". This triggers the use of the retrieval tools.