8mem
توضیحات
Agent memory your AI can finally keep. Visible. Correctable. Portable. Shared.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | 8mem-0.1.8 |
| نام | 8mem |
| نسخه کتابخانه | 0.1.8 |
| نگهدارنده | ['8mem Contributors'] |
| ایمیل نگهدارنده | [] |
| نویسنده | 8mem |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/8mem/ |
| مجوز | - |
# 8mem
<p align="center">
<img src="docs/assets/logo.svg" alt="8mem" width="260" />
</p>
**Agent memory your AI can finally keep.**<br>
**Visible. Correctable. Portable. Shared.**
Built by 8mem for people who want AI memory they can inspect, correct, and carry across agents.
8mem source code is licensed under the Apache License, Version 2.0. The 8mem name, logo, and brand assets are 8mem brand identifiers; the license does not grant permission to misrepresent ownership, impersonate 8mem, or use the 8mem brand in a misleading way.
8mem is a browser + Telegram personal memory system that remembers how you like replies, shows what it is using, and lets you correct it when it gets something wrong.
It is built for a simple but painful reality: every AI starts from scratch, and people repeat the same context, tone, preferences, and corrections every day.
8mem fixes that with a lightweight local stack:
- Markdown memory files
- JSONL event history
- SQLite structured facts
- optional `sqlite-vec` semantic retrieval
- Python memory logic
Works today with:
- Browser UI for local memory save, test, import, inspect, and edit
- Telegram bot when BotFather and a public HTTPS webhook are configured
- Ollama local models selected by the user during setup
- OpenClaw and Hermes agent integrations when those runtimes are installed
- Portable context export for ChatGPT, Claude, IDE assistants, and other tools
## 5-minute local quickstart
This is the fastest way to try 8mem locally. No cloud API key is required.
Today, the real supported runtime path is Ollama local.
### One-line install
Recommended public install:
```bash
curl -fsSL https://8mem.com/install.sh | bash
```
This script contains no secrets and does not require GitHub authentication. It downloads a pinned 8mem wheel from `https://8mem.com/app/install/`, verifies its SHA256 checksum, installs it into a local virtual environment, runs setup, then runs `8mem doctor`.
If you already use `pipx`, the manual package path is:
```bash
pipx install 8mem
```
Then run setup:
```bash
8mem setup --llm-model <your-installed-ollama-model>
8mem doctor
```
If you do not use `pipx`, plain pip also works inside your own virtual environment:
```bash
pip install 8mem
```
Privacy model: 8mem is local-first. Runtime config is written under `~/.8mem`, user memory stays on the user's machine by default, and Telegram/OpenClaw/Hermes tokens are supplied locally by the user during setup.
### 1. Install 8mem
```bash
curl -fsSL https://8mem.com/install.sh | bash
```
### 2. Start Ollama and pull one model
If Ollama is not installed yet, install it from [ollama.com](https://ollama.com).
```bash
ollama serve
```
In another terminal:
```bash
ollama pull <your-installed-ollama-model>
```
Example small model:
```bash
ollama pull qwen3:1.7b
```
### 3. Run guided setup
```bash
8mem setup --llm-model <your-installed-ollama-model>
8mem doctor
```
`8mem setup` writes local runtime config under `~/.8mem/.env`, creates memory templates, and avoids manual file editing. During setup, users can set up Telegram now, skip Telegram and use the local UI first, or run setup later when they have a BotFather token and public URL. `8mem doctor` verifies runtime files, Telegram config/webhook if present, local model access, and `/v1/context` readiness.
### Optional: semantic retrieval
8mem's truth path does not depend on vector search. Markdown remains user-readable memory, SQLite facts remain active truth, JSONL remains audit truth, and Engram remains runtime export.
For larger memory sets, imports, and better related-memory recall, install the optional semantic layer:
```bash
pip install "8mem[semantic]"
```
When installed, `sqlite-vec` is used as a local retrieval helper. If it is missing, 8mem keeps working through exact SQLite/Markdown memory.
### Optional: Wire OpenClaw Agent
For Type 1 OpenClaw users, this command is also available if you installed non-interactively or want to re-apply the managed OpenClaw block:
```bash
8mem setup --mode openclaw
```
This reads the OpenClaw workspace from `openclaw.json` when available, appends managed 8mem blocks to OpenClaw `AGENTS.md` and `HEARTBEAT.md`, patches `openclaw.json` so Telegram inline buttons are enabled, and restarts `openclaw-gateway` when systemd is available.
For a remote primary 8mem runtime, pass the API URL and bearer key:
```bash
8mem setup --mode openclaw \
--eightmem-api-url http://your-8mem-host:8787 \
--eightmem-api-key your-remote-8mem-key
```
The setup does not hardcode your bearer key into OpenClaw files. The connected OpenClaw agent reads `EIGHTMEM_OPENCLAW_API_KEY` from `~/.8mem/.env` for remote primary memory, or `EIGHTMEM_LOCAL_API_KEY` for single-machine local installs.
To undo the OpenClaw wiring:
```bash
8mem uninstall --mode openclaw
```
### 4. Initialize and verify the model path
```bash
8mem test-ollama --model <your-installed-ollama-model> --no-memory
```
### 5. Try the first real memory flow
```bash
8mem analyze examples/chat_export_sample.json
8mem ask-ollama "What do you know about how I like responses?" --model <your-installed-ollama-model>
8mem start
8mem status
```
Then open:
- `http://127.0.0.1:8787`
- `http://127.0.0.1:8787/chat`
Use `8mem stop` to stop the background server. Use `8mem start --foreground` for foreground debugging.
### Uninstall
To stop 8mem and remove the installed Python package:
```bash
8mem stop
pipx uninstall 8mem
```
If you installed with plain pip instead of pipx:
```bash
pip uninstall 8mem
```
8mem keeps `~/.8mem` by default so your local memory is not deleted accidentally. To permanently delete local 8mem memory and runtime config:
```bash
rm -rf ~/.8mem
```
If you connected OpenClaw, remove only the 8mem-managed OpenClaw integration:
```bash
8mem uninstall --mode openclaw
```
This does not uninstall OpenClaw itself.
If you installed 8mem as a user systemd service, update with:
```bash
git pull
bash ./install.sh
systemctl --user restart 8mem.service
8mem status
```
Without systemd, update with:
```bash
git pull
bash ./install.sh
8mem stop
8mem start
8mem status
```
If you want the full Telegram-style product flow, keep reading below.
## Why 8mem
Most AI memory products have the same problem:
- you cannot see what the AI knows about you
- you cannot correct it safely
- you cannot move that memory between tools
8mem is designed around the opposite principles:
- **visible**: memory is readable in plain files
- **correctable**: contradictions are surfaced, not hidden
- **portable**: memory can be reused across tools
- **local-first**: your memory stays on your machine
## What 8mem does
You talk normally in Telegram. 8mem picks up what matters, stores it, and uses it later.
Example:
```text
You: Keep my work replies concise
8mem: I'll keep my work replies concise.
Saved to memory: Keep my work replies concise.
You: Don't use emojis in client messages
8mem: I won't use emojis in client messages.
Saved to memory: Don't use emojis in client messages.
You: Reply like me: can we move tomorrow's meeting
8mem: Can we move tomorrow's meeting? Share a time that works for you.
```
You can also ask:
- `What do you remember about me?`
- `What are you using right now?`
- `What changed about me?`
- `Show me the normal version vs mine`
## Demo
### Passport
The clearest artifact in 8mem is `/passport`: a visible summary of the memory it is actively using for you.

### Telegram flow

## The best product surfaces
### `/passport`
Shows the memory 8mem is actively using for you.

### `/compare`
Shows a standard answer next to a memory-shaped answer so you can see whether memory is actually improving output.
### `What changed about me?`
Shows recent memory changes in a human-readable way.
These three surfaces make memory visible instead of hidden.
## Product shape today
### Browser + Telegram
- natural memory capture
- memory-aware replies and drafts
- recall, compare, passport, recent changes
- contradiction resolution with inline choices
- undo and reset
### Web UI
- dashboard
- mirror
- files
- editor
- inbox
- export
### Portable context
- ChatGPT and Claude use 8mem through exported context today
- OpenClaw and Hermes use managed runtime integrations when installed
- local models use the Ollama model selected during setup
### Storage and logic
- `Markdown` for human-readable memory
- `JSONL` for append-only event history
- `SQLite` for structured facts and mirrored events
- optional `sqlite-vec` for local semantic search
- Python rules for contradiction and trust logic
## Features
### Natural memory capture
- save obvious preferences without requiring `Remember:`
- save obvious corrections without requiring `Correct:`
- still support explicit power-user commands
- ignore ambiguous statements instead of saving them aggressively
### Memory visibility
- `What do you remember about me?`
- `What are you using right now?`
- `/passport`
- `What changed about me?`
- `8mem forget <text>` to remove a saved memory with confirmation
### Memory-aware output
- `Reply like me: ...`
- `Draft: ...`
- `/compare ...`
### Passport and compare
`/passport` shows the memory 8mem is actively using: profile, useful facts, recent corrections, and trust checks. It is meant to make memory visible instead of hidden inside a black-box assistant.
`/compare <task>` shows a generic answer next to a memory-shaped answer. Use it when you want to prove that saved preferences and corrections are actually changing output.
### Trust and control
- contradiction detection
- contradiction resolution
- undo last memory change
- reset memory
### Natural routing
- typo-tolerant recall
- natural aliases for compare, recall, draft, and memory view
- onboarding with `/start`, `help`, and `what can you do`
## How it works
Short flow:
```text
User
-> Telegram
-> ui/app.py webhook
-> telegram_service
-> exact / fuzzy / LLM intent router
-> memory_service
-> Markdown + JSONL + SQLite + optional sqlite-vec
-> response assembly
-> ui/app.py sender
-> Telegram
-> User
```
### The architecture
| Layer | Component | Responsibility |
|---|---|---|
| Interface | Telegram + web UI | Receive input, present output |
| Routing | `telegram_service.py` | Intent routing, UX shaping |
| Memory logic | `memory_service.py` | Normalization, recall, compare, trust logic |
| Storage | Markdown + JSONL + SQLite | Readable memory, event history, structured facts |
| Retrieval | optional `sqlite-vec` | Semantic memory lookup when installed |
| Ingestion | `ingestion.py` + `import_cache.py` | Chunking, candidate fact extraction, apply-to-memory flow |
## Install
### Package path
```bash
pipx install 8mem
```
If you prefer `pip`:
```bash
pip install 8mem
```
For the supported local setup, run:
```bash
8mem setup --llm-model <your-installed-ollama-model>
8mem doctor
```
Source installs are for contributors with repository access. Public users should use the package path above.
## Quickstart
### Fastest first success
```bash
8mem setup --llm-model <your-installed-ollama-model>
8mem doctor
8mem test-ollama --model <your-installed-ollama-model> --no-memory
8mem analyze examples/chat_export_sample.json
8mem ask-ollama "What do you know about how I like responses?" --model <your-installed-ollama-model>
8mem start
8mem status
```
Open:
- `http://127.0.0.1:8787`
- `http://127.0.0.1:8787/chat`
### Import and mirror flow
```bash
8mem analyze examples/chat_export_sample.json
8mem mirror
8mem export-context -o context.txt
```
## Telegram examples
### Save a preference
```text
Keep my work replies concise
```
### Save a correction
```text
Don't use emojis in client messages
```
### Recall
```text
What do you remember about me?
```
### Memory view
```text
What are you using right now?
```
### Compare
```text
Compare the normal version with mine: answer this client: Can we move the meeting to Friday?
```
### Draft in my style
```text
Reply like me: can we move tomorrow's meeting
```
### Recent changes
```text
What changed about me?
```
## Power-user commands
Core commands:
- `Remember: keep answers concise`
- `Correct: do not use emojis`
- `What do you know about me`
- `Draft: write a founder update in my style`
- `reset memory`
- `undo last memory change`
Profile and comparison:
- `/passport`
- `/compare Draft: write a founder update in my style`
- `/compare Draft: recommend a laptop in my style`
- `/compare Reply: answer this client in my style: <paste client message>`
- `/compare Summarize: summarize this update in my style`
## Memory files
Stored in `~/.8mem/memory/`:
- `IDENTITY.md`
- `BELIEFS.md`
- `PREFERENCES.md`
- `CORRECTIONS.md`
- `EVOLUTION.md`
- `DECISIONS.md`
- `.memory_events.jsonl`
Markdown files remain the readable source of truth.
## Repo structure
```text
src/eightmem/
cli/
core/
analyzers/
importers/
mirror/
services/
ui/
examples/
tests/
docs/
```
## Screenshots
Dashboard

Memory editor

Telegram demo

## Current status
- Phase 4 complete
- Telegram product loop in place
- `81` tests passing in the latest verified product pass
The core loop now includes:
- natural memory capture
- recall
- passport
- compare
- recent changes
- conflict resolution
- undo
- reset
- memory-aware draft/reply
## What makes 8mem different
1. **Readable memory**
Every memory is a file you can open and verify.
2. **Visible trust**
You can see what 8mem knows, what it is using, and what changed.
3. **Portable memory**
Memory is not trapped in one black-box product.
4. **Lightweight architecture**
No heavy graph stack required to get useful memory behavior.
## Roadmap
Near-term:
- launch cleanup
- packaging cleanup
- public repo polish
- stronger `/passport` sharing story
Longer-term:
- broader import flows
- richer memory standard / portability story
- cross-agent memory propagation story
## Contributing
PRs are welcome. Keep changes:
- local-first
- readable
- test-backed
- memory-safe
نیازمندی
| مقدار | نام |
|---|---|
| - | typer>=0.12.0 |
| - | fastapi>=0.115.0 |
| - | uvicorn>=0.30.0 |
| - | jinja2>=3.1.0 |
| - | python-multipart>=0.0.9 |
| - | pillow>=10.0.0 |
| - | ruamel.yaml>=0.18.0 |
| xtr | pytest>=8.2.0; |
| xtr | httpx>=0.27.0; |
| xtr | sqlite-vec>=0.1.9; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.11 | Python |
نحوه نصب
نصب پکیج whl 8mem-0.1.8:
pip install 8mem.whl
نصب پکیج tar.gz 8mem-0.1.8:
pip install 8mem.tar.gz