Skip to main content

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 search
  • LLMProvidercomplete() and complete_json()
  • EmbeddingProviderembed(), embed_batch(), dimensions
  • BlockStorageProvider — session block persistence

License

MIT

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

solohq_memory-0.1.0.tar.gz (194.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solohq_memory-0.1.0-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

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

Hashes for solohq_memory-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21e4ce4029281690c31005b300ab029f9b4e6ed1e83c41e7168ccfb7b6679aa5
MD5 0d1cd4991d5e64e423f4c303bbf1ebe8
BLAKE2b-256 31235f1876c56c2802b3ce27f4a45fa35d444b89d43a97495a6187f912dc8df2

See more details on using hashes here.

Provenance

The following attestation bundles were made for solohq_memory-0.1.0.tar.gz:

Publisher: publish.yml on whaleventure13/solohq-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for solohq_memory-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c5ac2d2c893343dfb1dd064b9f7a9090f858e121803b4e7ea7b517a6e1727f9
MD5 9cbe98d18e9d32c82827ccccf68195e5
BLAKE2b-256 0b13cc768c59c0acc394af990be52e207f7f456c5b06cc7e899eaf4c0a2fadb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for solohq_memory-0.1.0-py3-none-any.whl:

Publisher: publish.yml on whaleventure13/solohq-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page