# AI use cases for Octop Memory (TencentCloud/octop-memory)

Repo: [TencentCloud/octop-memory](https://github.com/TencentCloud/octop-memory) | Use cases: 4 | Page: https://dedupedai.com/use-cases/tencentcloud-octop-memory/

Octop Memory is a Python library, CLI, and JSON-RPC bridge that gives LLM agents persistent, portable memory backed by SQLite or PostgreSQL.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Keep an assistant's preferences across sessions locally: https://dedupedai.com/use-cases/tencentcloud-octop-memory/persist-assistant-preferences-locally/
- Move accumulated agent memory to another host: https://dedupedai.com/use-cases/tencentcloud-octop-memory/carry-agent-memory-between-hosts/
- Add capture and recall to a custom Python agent: https://dedupedai.com/use-cases/tencentcloud-octop-memory/add-memory-to-a-python-agent/
- Expose memory to agents in other languages over JSON-RPC: https://dedupedai.com/use-cases/tencentcloud-octop-memory/serve-memory-to-other-language-agents/

## How to keep an assistant's preferences across sessions locally with Octop Memory

Repo: [TencentCloud/octop-memory](https://github.com/TencentCloud/octop-memory) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Store user preferences in a local SQLite file and recall them in later sessions.

**Who it is for:** A developer building a personal assistant who needs it to remember stated preferences between conversations.

**The problem:** Each new session starts without the user's stated preferences, so the assistant repeats questions and ignores earlier choices.

**The outcome:** Preferences are saved to a local database and returned as ranked prompt context when the topic comes up again.

### Steps

1. Run `pip install octop-memory`
2. Run `pip install "octop-memory[cli]"` to add the command line tool
3. Create a Memory object with namespace="demo" and backend_config={"db_path": "./demo.sqlite"}, then call memory.store("User prefers Python for backend services", topic="preferences")
4. Run `octop-memory --db ./demo.sqlite --namespace demo recall "Python"` to confirm the stored preference is found
5. Call MemoryService(memory).recall("Python") in your assistant and inject result.rendered into the prompt

### Prompt to paste into your agent

```text
Use the octop-memory repo to store the preference <preference text> in a local SQLite file at ./demo.sqlite under namespace demo. Then recall it with the query <query term> and return the rendered result. Verify that the returned text contains the stored preference.
```

### Caveat

Manual storage and lexical recall need no model, but automated extraction only runs after you inject an LLMClient, since installing the package does not configure one.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/tencentcloud-octop-memory/persist-assistant-preferences-locally/

## How to move accumulated agent memory to another host with Octop Memory

Repo: [TencentCloud/octop-memory](https://github.com/TencentCloud/octop-memory) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Pack memory from one supported host into a portable package and adopt it on another.

**Who it is for:** A team lead who runs OpenClaw or Hermes and wants to switch hosts without losing project decisions and context.

**The problem:** Accumulated decisions and context are tied to one host, so moving to another agent means starting over.

**The outcome:** Memory is exported as a .hmpkg package and adopted by the target host, with the package checked by the doctor command.

### Steps

1. Run `pip install "octop-memory[cli]"`
2. Run `octop-memory portable list-sources` to see which memory sources the tool can read (inferred, check the README)
3. Run `octop-memory portable pack` to write a .hmpkg package from the source memory (inferred, check the README)
4. Run `octop-memory portable adopt` on the target host with the package file (inferred, check the README)
5. Run `octop-memory portable doctor` to check the adopted memory (inferred, check the README)

### Prompt to paste into your agent

```text
Use the octop-memory repo to list memory sources, pack the memory of <source host> into a .hmpkg file at <output path>, and adopt it on <target host>. Report the output of the portable doctor check and confirm that the package is not added to source control.
```

### Caveat

Exported .hmpkg files contain memory data, so keep them out of source control and treat them as sensitive.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/tencentcloud-octop-memory/carry-agent-memory-between-hosts/

## How to add capture and recall to a custom Python agent with Octop Memory

Repo: [TencentCloud/octop-memory](https://github.com/TencentCloud/octop-memory) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Call MemoryService from your own agent loop to capture turns and recall context.

**Who it is for:** A Python developer building a custom agent who needs it to keep context from earlier turns and sessions.

**The problem:** The agent loses earlier conversation context and has no shared memory layer to query.

**The outcome:** Each turn is captured and relevant memory is returned as prompt-ready text before the next model call.

### Steps

1. Run `pip install octop-memory`
2. Create a Memory object with namespace="<namespace>" and backend_config={"db_path": "<db path>"}
3. Wrap it with MemoryService(memory) in your agent code
4. Call capture_turn() after each exchange, and recall("<query>") before each model call
5. Inject result.rendered into the model prompt and print it during testing

### Prompt to paste into your agent

```text
Use the octop-memory repo to wire MemoryService into the agent in <project path> with the SQLite database at <db path>. Run one captured turn and one recall with the query <query>, then return result.rendered. Verify that the recall output includes the text from the captured turn.
```

### Caveat

Automated capture and extraction depend on the LLMClient you inject, because the package does not configure a model on install.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/tencentcloud-octop-memory/add-memory-to-a-python-agent/

## How to expose memory to agents in other languages over JSON-RPC with Octop Memory

Repo: [TencentCloud/octop-memory](https://github.com/TencentCloud/octop-memory) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Run the stdio bridge so a non-Python agent can read and write the same memory.

**Who it is for:** A platform engineer whose agent runs in another language and needs to share the Python memory runtime through a separate process.

**The problem:** The agent host cannot import the Python library directly, so memory is unavailable to it.

**The outcome:** The host talks to the memory runtime over stdio JSON-RPC and can capture, recall, and search memory.

### Steps

1. Run `pip install octop-memory`
2. Start the `octopmemory-bridge` entry point as a subprocess and connect to its stdio stream (inferred, check the README)
3. Send a JSON-RPC request from the host to capture a turn
4. Send a JSON-RPC recall request with a query
5. Check that the response contains the text you captured

### Prompt to paste into your agent

```text
Use the octop-memory repo to start the octopmemory-bridge process for the host <host name> and send one capture and one recall request for the query <query>. Return the recall response. Verify that the captured text appears in the recall response.
```

### Caveat

The README documents the bridge entry point but not its request method names, so take the exact JSON-RPC methods from the integration guide before you send requests.

Risk, credentials: If the bridge points at PostgreSQL, the DSN contains database credentials, so load it from deployment configuration rather than hard-coding it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/tencentcloud-octop-memory/serve-memory-to-other-language-agents/
