mirror of
https://github.com/tkenaz/breathe-memory.git
synced 2026-08-28 04:24:59 +00:00
Context optimization and associative memory for LLM applications. Two-phase system: SYNAPSE (pre-generation memory injection) + GraphCompactor (structured context compression). - Interface-based, storage-agnostic, LLM-agnostic - Memory Nexus: PostgreSQL + pgvector reference backend - Zero mandatory dependencies beyond stdlib - 28 tests passing, clean install verified Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38 lines
950 B
Python
38 lines
950 B
Python
"""
|
|
Memory Nexus — hybrid semantic memory for LLM applications.
|
|
|
|
Provides persistent memory storage with semantic search via pgvector.
|
|
Integrates with BREATHE as a VectorSearchClient backend.
|
|
|
|
Architecture:
|
|
MemoryStore — abstract storage interface
|
|
PostgresStore — asyncpg + pgvector implementation (optional dep)
|
|
HybridSearch — dense + keyword search
|
|
|
|
Quick start::
|
|
|
|
from memory_nexus import PostgresMemoryStore
|
|
from breathe import Synapse
|
|
|
|
store = PostgresMemoryStore(dsn="postgresql://...")
|
|
await store.initialize()
|
|
|
|
synapse = Synapse(vector_client=store)
|
|
"""
|
|
from .models import Memory, MemoryMetadata
|
|
from .store import MemoryStore
|
|
|
|
__version__ = "0.1.0"
|
|
|
|
__all__ = [
|
|
"Memory",
|
|
"MemoryMetadata",
|
|
"MemoryStore",
|
|
]
|
|
|
|
# Optional: PostgreSQL backend (requires asyncpg + pgvector)
|
|
try:
|
|
from .postgres import PostgresMemoryStore
|
|
__all__.append("PostgresMemoryStore")
|
|
except ImportError:
|
|
pass
|