Context memory system for AI agents — persistent context graph with episodes, artifacts, relationships, and staleness tracking
Project description
solohq-memory
Core context memory library for AI agents. Persistent context graph with episodes, artifacts, relationships, and staleness tracking.
Installation
pip install solohq-memory
# With LLM provider extras
pip install solohq-memory[anthropic]
pip install solohq-memory[openai]
pip install solohq-memory[google]
pip install solohq-memory[all]
Quick Start
from solohq_memory import (
ContextMemoryManager,
SqliteVecStorage,
)
# You need to provide LLM and embedding implementations
# that satisfy LLMProvider and EmbeddingProvider protocols
storage = SqliteVecStorage("memory.db", dimensions=1536)
manager = ContextMemoryManager(
storage=storage,
llm=your_llm_provider,
embedder=your_embedding_provider,
)
# Classify a message to find or create a context
result = await manager.classify("Tell me about Python decorators")
context = result.context
# Record an episode
await manager.record_episode(
context_id=context.id,
user_message="Tell me about Python decorators",
assistant_message="Decorators are a way to modify functions...",
)
# Search across all contexts
results = await manager.search("decorators", limit=5)
Key Components
- ContextMemoryManager — main orchestrator for context operations
- SqliteVecStorage — SQLite + sqlite-vec storage with vector search
- LLMClassifier — 3-tier context routing: stable shortcut, embedding similarity, LLM fallback
- ArtifactManager — versioned content objects with rollback support
- EpisodeRecorder — conversation recording
- BoundaryDetector — topic shift detection (heuristics + LLM)
- FileIndexer — file indexing (on-disk references) and upload (full content)
Interfaces
All providers are protocol-based and pluggable:
StorageProvider— CRUD + vector searchLLMProvider—complete()andcomplete_json()EmbeddingProvider—embed(),embed_batch(),dimensionsBlockStorageProvider— session block persistence
License
MIT
Project details
Release history Release notifications | RSS feed
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 solohq_memory-0.1.0.tar.gz.
File metadata
- Download URL: solohq_memory-0.1.0.tar.gz
- Upload date:
- Size: 194.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21e4ce4029281690c31005b300ab029f9b4e6ed1e83c41e7168ccfb7b6679aa5
|
|
| MD5 |
0d1cd4991d5e64e423f4c303bbf1ebe8
|
|
| BLAKE2b-256 |
31235f1876c56c2802b3ce27f4a45fa35d444b89d43a97495a6187f912dc8df2
|
Provenance
The following attestation bundles were made for solohq_memory-0.1.0.tar.gz:
Publisher:
publish.yml on whaleventure13/solohq-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
solohq_memory-0.1.0.tar.gz -
Subject digest:
21e4ce4029281690c31005b300ab029f9b4e6ed1e83c41e7168ccfb7b6679aa5 - Sigstore transparency entry: 983802390
- Sigstore integration time:
-
Permalink:
whaleventure13/solohq-agent@cd2ba08eb09a95b64fda16d8781ab89e8f4a6617 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/whaleventure13
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cd2ba08eb09a95b64fda16d8781ab89e8f4a6617 -
Trigger Event:
release
-
Statement type:
File details
Details for the file solohq_memory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: solohq_memory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 51.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c5ac2d2c893343dfb1dd064b9f7a9090f858e121803b4e7ea7b517a6e1727f9
|
|
| MD5 |
9cbe98d18e9d32c82827ccccf68195e5
|
|
| BLAKE2b-256 |
0b13cc768c59c0acc394af990be52e207f7f456c5b06cc7e899eaf4c0a2fadb2
|
Provenance
The following attestation bundles were made for solohq_memory-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on whaleventure13/solohq-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
solohq_memory-0.1.0-py3-none-any.whl -
Subject digest:
7c5ac2d2c893343dfb1dd064b9f7a9090f858e121803b4e7ea7b517a6e1727f9 - Sigstore transparency entry: 983802393
- Sigstore integration time:
-
Permalink:
whaleventure13/solohq-agent@cd2ba08eb09a95b64fda16d8781ab89e8f4a6617 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/whaleventure13
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cd2ba08eb09a95b64fda16d8781ab89e8f4a6617 -
Trigger Event:
release
-
Statement type: