# Memory Layer

The memory layer ensures that agents and robots can store, retrieve, and reference information reliably across decentralized environments. Data is stored off-chain using distributed storage systems such as IPFS, Arweave, or Filecoin.&#x20;

<figure><img src="/files/CRcMqVjaazunXuNHFzFD" alt=""><figcaption></figcaption></figure>

On-chain references provide verifiable links to this off-chain memory, ensuring that information remains tamper-proof and auditable. This structure allows agents to build long-term memory, share knowledge with other agents, and maintain continuity in complex, multi-step tasks.

Agents need long-term and short-term memory.

* **Off-chain storage:**\
  Data is stored in IPFS, Arweave, or Filecoin. Each record has a verifiable hash on-chain.

  ```javascript
  MemoryRef = { CID, hash(CID), timestamp }
  ```
* **On-chain reference integrity:**

  ```javascript
  Verify(Memory) = sha256(data) == hash(CID)
  ```
* **Use case:** Sensor data, execution logs, or AI fine-tuning datasets.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.synthos.link/core-architecture/memory-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
