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

# Examples

> A complete, runnable script for every framework adapter.

Each adapter ships a full working program, not a snippet. They live in the SDK
repository under
[`examples/`](https://github.com/anonalabs/Anona-Memory-SDK/tree/main/examples).

```bash theme={null}
git clone https://github.com/anonalabs/Anona-Memory-SDK.git
cd Anona-Memory-SDK

export ANONA_API_KEY=anona_live_YOUR_KEY
export ANONA_SPACE_ID=my-space          # optional, each script has a default

python examples/langchain_agent.py
```

| Framework | Script | Install |
| - | - | - |
| [LangChain / LangGraph](https://docs.memory.anonalabs.com/integrations/langchain.md) | [`langchain_agent.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/langchain_agent.py) | `pip install 'anona[langchain]' langchain-openai` |
| [CrewAI](https://docs.memory.anonalabs.com/integrations/crewai.md) | [`crewai_crew.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/crewai_crew.py) | `pip install 'anona[crewai]'` |
| [LlamaIndex](https://docs.memory.anonalabs.com/integrations/llamaindex.md) | [`llamaindex_agent.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/llamaindex_agent.py) | `pip install 'anona[llamaindex]' llama-index-llms-openai aiosqlite` |
| [Google ADK](https://docs.memory.anonalabs.com/integrations/google-adk.md) | [`google_adk_agent.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/google_adk_agent.py) | `pip install 'anona[adk]'` |
| [Microsoft Agent Framework](https://docs.memory.anonalabs.com/integrations/microsoft-agent-framework.md) | [`ms_agent_framework.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/ms_agent_framework.py) | `pip install 'anona[msagent]' agent-framework-openai` |
| [AWS Strands](https://docs.memory.anonalabs.com/integrations/strands.md) | [`strands_agent.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/strands_agent.py) | `pip install 'anona[strands]'` |

The model and provider in each script are only there to make it run. Swap in
whatever your app already uses; nothing about the memory wiring depends on them.

## What to look for

Every script asks two questions in a row, where the second is only answerable
from what the first one stored. **Run it twice**: the second run starts with the
first run's memories already in the space, so it can answer the opening question
too.

They differ from each other on purpose, because the frameworks do:

> **Automatic**
>
> **LangChain** and **Microsoft Agent Framework**: one middleware or one
> context provider, and every turn is recalled and stored.

> **Model's choice**
>
> **CrewAI** and **Strands** expose memory as tools. Both scripts spend prompt
> text telling the model when to call them; that wording is part of the
> integration.

> **Wire it yourself**
>
> **Google ADK** automates neither direction: `load_memory` gives the model a
> search tool, an `after_agent_callback` stores the turn.

> **Explicit capture**
>
> **LlamaIndex** only flushes a turn once its own buffer overflows, so the last
> turn never lands by itself. That script calls `bridge.remember(...)`.

## Failure behaviour

Every adapter fails open. If Anona is unreachable, the recall or the store is
logged and the agent runs on without memory. The one thing that does raise is a
usage error, not a failure: LangChain's `AnonaRetriever` is async-only, so its
sync `invoke()` raises `NotImplementedError` — call `ainvoke()`. No runtime
memory failure reaches your code.

To see it for yourself, run any script with a deliberately wrong API key: it
still answers, it just remembers nothing.

> [!NOTE]
>
> The scripts are executed by the SDK's own test suite against each real
> framework, so an example that stopped working would fail CI rather than reach
> you broken.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.