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

# Emem

> MCP emem Agent - Shared Memory for AI Agents Working in the Real World.

```python emem.py theme={null}
"""MCP emem Agent - Shared Memory for AI Agents Working in the Real World

emem is shared memory for AI agents working together in the real world. One
agent writes down what it observed. Another agent reads the same bytes, not a
summary of them. Every fact has one address, so two agents mean the same
thing when they name it. Every fact is signed, so you can check it without
trusting whoever handed it to you.

No API key or account is required for reads.

Example prompts to try:
- "Has this place flooded historically?"
- "What's the air quality at this place right now?"
- "Is this neighbourhood hot for an urban area?"
- "How similar are two places?"
- "Has this place lost forest?"

Run: `uv pip install agno mcp openai` to install the dependencies
"""

import asyncio

from agno.agent import Agent
from agno.tools.mcp import MCPTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

server_url = "https://emem.dev/mcp"


async def run_agent(message: str) -> None:
    async with MCPTools(transport="streamable-http", url=server_url) as mcp_tools:
        agent = Agent(
            tools=[mcp_tools],
            markdown=True,
        )
        await agent.aprint_response(input=message, stream=True, markdown=True)


# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    asyncio.run(run_agent("Has this place flooded historically? Mumbai, India."))
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[mcp]" openai
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `emem.py`, then run:

    ```bash theme={null}
    python emem.py
    ```
  </Step>
</Steps>

Full source: [cookbook/91\_tools/mcp/emem.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/91_tools/mcp/emem.py)
