Local-first AI memory engine for Copilot CLI and Claude Code.
Project description
AI Memory Engine
Local-first memory engine for GitHub Copilot CLI and Claude Code.
What it does
- stores reusable memory from conversations
- keeps Markdown as the source of truth
- builds derived indexes for retrieval
- exposes a shared local MCP server for both agents
Architecture
Claude Code / Copilot CLI
↓
Local MCP stdio server
↓
AI Memory Engine (Python)
├─ Conversation ingest
├─ Memory extraction
├─ Markdown memory store
├─ Incremental sync pipeline
├─ Retrieval / ranking
└─ Event emission
↓
├─ LanceDB
├─ LadybugDB
└─ DuckDB
Install
python -m pip install -e .
Publish and install from PyPI
Once the package is published to PyPI, users can install or run it without cloning this repository.
Install the CLI from PyPI
python -m pip install omoide-ai
Run the MCP server with uvx
uvx --from omoide-ai omoide-ai-mcp
MCP config for a published package
For clients that launch a local stdio MCP server, point them at uvx instead of a repository-local virtualenv:
{
"mcpServers": {
"omoide-ai": {
"type": "local",
"command": "uvx",
"args": ["--from", "omoide-ai", "omoide-ai-mcp"],
"timeout": 60000
}
}
}
Maintainer release flow
- Create a GitHub release or run the
Publish PyPIworkflow manually. - Add a repository secret named
PYPI_API_TOKEN. - The workflow builds the package with
uv buildand uploads it to PyPI. - If the same version has already been published, the workflow skips the existing files instead of failing. To publish a new release, update
versioninpyproject.tomlfirst.
Project layout
Markdown under knowledge/ is the source of truth. Derived state is written under .ai-memory-engine/. Daily interaction journals are appended under journal/.
You do not need to pre-create fixed folders. The engine places memories into generic folders based on their role, for example:
knowledge/
decisions/
constraints/
reference/
work-context/tasks/
work-context/open-questions/
user-profile/preferences/
user-profile/products/
journal/
2026-06-30.md
Rules are generic rather than technical:
decisionmemories go toknowledge/decisions/constraintmemories go toknowledge/constraints/factmemories go toknowledge/reference/task-contextmemories go toknowledge/work-context/tasks/open-questionmemories go toknowledge/work-context/open-questions/user-profiletags oruser_subjects go toknowledge/user-profile/...
If you want to hint a custom nested folder, pass a slash-delimited category such as vendors/schick.
CLI examples
omoide-ai sync
omoide-ai rebuild
omoide-ai search "What runtime did we choose?"
omoide-ai prepare-turn --session-id demo --message "このプロジェクトは Python で実装したい"
omoide-ai finalize-turn --turn-token <token> --assistant-message "了解。Python で進めます。"
Each finalize-turn call still promotes reusable memory into knowledge/, and now also appends the full exchange to that day's Markdown journal in journal/YYYY-MM-DD.md.
For MCP usage, the effective project root now resolves in this order:
AI_MEMORY_ENGINE_PROJECT_ROOTCLAUDE_PROJECT_DIR- a project root discovered from the request's
project_pathorcwd - the request's
cwd - the MCP server process context as a final fallback
Locked memory mode
If you want the assistant to answer against a fixed set of memories, set AI_MEMORY_ENGINE_LOCKED_MEMORY_IDS to a comma- or newline-delimited list of memory_id values before calling prepare-turn.
AI_MEMORY_ENGINE_LOCKED_MEMORY_IDS=implementation-runtime,markdown-source-of-truth
In this mode:
prepare-turnskips live retrieval and always returns the configured memories in the given ordercontext_blockstarts withLocked memory context:finalize-turnstill stores the conversation in analytics and the journal, but skips promoting new Markdown memories so the memory base stays fixed
If any configured memory_id does not exist, prepare-turn fails fast instead of silently falling back to dynamic retrieval.
MCP setup
Claude Code
This repository includes .mcp.json for repository-local development. After publishing to PyPI, you can switch the command to the uvx example above.
GitHub Copilot CLI
This repository includes .github/mcp.json for repository-local development. After publishing to PyPI, you can switch the command to the uvx example above.
Repository-scoped instructions are included in:
CLAUDE.md.github/copilot-instructions.md
Optional AI-assisted extraction
The engine includes an optional refinement step for memory extraction. It stays offline-first by default and does nothing unless you configure a local command.
Set AI_MEMORY_ENGINE_ASSIST_COMMAND to a local command that:
- reads JSON from stdin
- returns JSON on stdout
- outputs a
candidatesarray with refined memory candidates
Example shape:
{
"candidates": [
{
"memory_id": "implementation-runtime",
"title": "Implementation Runtime",
"kind": "decision",
"summary": "The implementation runtime is python.",
"subject": "implementation_runtime",
"value": "python",
"category": "project/implementation",
"tags": ["python", "runtime"],
"details": ["Refined by local model"],
"confidence": 0.98,
"importance_score": 0.99
}
]
}
Use AI_MEMORY_ENGINE_ASSIST_TIMEOUT_SECONDS to control the subprocess timeout.
Notes
DuckDB,LanceDB, andLadybugDBare required runtime dependencies.- The graph index is stored under
.ai-memory-engine/graph/using LadybugDB (memory.lbug). - Markdown remains the source of truth even though vector and graph stores are always persisted.
Resetting memory state
Use the following command to clear saved Markdown memories and derived local state before a fresh verification run:
omoide-ai reset --yes
This resets knowledge/ memories, DuckDB analytics, the index manifest, pending turns, and derived vector/graph state.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omoide_ai-0.1.3.tar.gz.
File metadata
- Download URL: omoide_ai-0.1.3.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d96f2a3687a38ea6a91d93d752f31912ff6a82b204b6ff4e0d1db96caa174fdc
|
|
| MD5 |
17c6ce56fc3296fb74a76a763035b937
|
|
| BLAKE2b-256 |
b1da1eed4977bc38b843a3abfbf5443b6c7ad9c68c587fac8daddc7aa9107263
|
File details
Details for the file omoide_ai-0.1.3-py3-none-any.whl.
File metadata
- Download URL: omoide_ai-0.1.3-py3-none-any.whl
- Upload date:
- Size: 36.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a7ddfafc37a6c795f98b1a32de1d8d8501f1cb5ba23bb57486376ae4ab32159
|
|
| MD5 |
23377cd644f49bc369d2fbef7b045f11
|
|
| BLAKE2b-256 |
da729b7dac1bf269dbe0483b3aef85077a9f2979e3c63a92a467bee87f8ff0a2
|