> ## Documentation Index
> Fetch the complete documentation index at: https://docs.evermind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MemCell

> The atomic primitive of the EverOS memory system

At the heart of EverOS lies the **MemCell**—the fundamental, atomic unit of memory. Unlike a raw text chunk used in vector databases, a MemCell is a structured, semantic object that encapsulates a complete "moment" of interaction.

## Anatomy of a MemCell

A MemCell is not just text; it is a tuple containing four critical components: $\mathcal{M} = (E, \mathcal{A}, \mathcal{F}, T)$

<CardGroup cols={2}>
  <Card title="Episode (E)" icon="book-open">
    A concise, narrative summary of "what happened." It captures the flow of events and user intent, preserving the causal logic of the interaction.
  </Card>

  <Card title="Atomic Facts (A)" icon="list-check">
    A set of discrete, verifiable statements derived from the episode (e.g., "User likes spicy food," "Project deadline is Friday"). These facilitate precise factual queries.
  </Card>

  <Card title="Foresight (F)" icon="eye">
    Forward-looking inferences and predictions. If a user says "I'm flying to Paris tomorrow," the Foresight component records the future implication (User will be in Paris) with a validity interval.
  </Card>

  <Card title="Metadata (T)" icon="tag">
    Contextual grounding, including timestamps, location, source confidence, and emotional valence. This helps the system understand *when* and *where* a memory applies.
  </Card>
</CardGroup>

## From Raw Logs to MemCells

The process of **Episodic Trace Formation** converts raw chat logs into MemCells.

1. **Segmentation**: The system detects boundaries in the conversation (e.g., a topic change or a significant time gap).
2. **Extraction**: An LLM parses the segment to extract the narrative ($E$) and facts ($\mathcal{A}$).
3. **Inference**: The system analyzes the text for future implications ($\mathcal{F}$).
4. **Packaging**: All components are wrapped into a MemCell and assigned a unique ID.

<CodeGroup>
  ```json JSON Structure theme={null}
  {
    "memcell_id": "mc_123456789",
    "episode": "The user discussed plans for the Q3 marketing campaign, emphasizing a focus on social media channels.",
    "atomic_facts": [
      "User role is Marketing Manager",
      "Q3 campaign focus is Social Media",
      "Budget approval needed by Friday"
    ],
    "foresight": {
      "prediction": "User will submit budget proposal",
      "valid_after": "2023-10-10T09:00:00Z",
      "valid_until": "2023-10-13T17:00:00Z"
    },
    "metadata": {
      "created_at": "2023-10-09T14:30:00Z",
      "source": "slack_integration"
    }
  }
  ```
</CodeGroup>

## The "Engram" of AI

Think of a MemCell as an **engram** in the biological brain—a physical trace of a memory. It bridges the gap between low-level raw data (pixels/tokens) and high-level abstract reasoning. By storing memories as MemCells, EverOS ensures that information is:

* **Retrievable**: By semantic vector or specific fact.
* **Understandable**: Self-contained and context-aware.
* **Actionable**: Includes implications for future behavior.
