Metadata-Version: 2.4
Name: synapse-memory-engine
Version: 1.3.0
Summary: Production-grade active RAG & cognitive memory engine with multi-tenancy, pgvector HNSW indexing, semantic deduplication, decay-based pruning, and token-aware context packing.
Home-page: https://github.com/721189/Synapse-Memory
Author: Synapse Cognitive Systems
Author-email: Synapse Cognitive Systems <singhshivam20009@gmail.com>
Project-URL: Homepage, https://github.com/721189/Synapse-Memory
Project-URL: Bug Tracker, https://github.com/721189/Synapse-Memory/issues
Project-URL: Documentation, https://github.com/721189/Synapse-Memory#readme
Project-URL: Repository, https://github.com/721189/Synapse-Memory.git
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.115.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: uvicorn>=0.34.0
Requires-Dist: cryptography>=42.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: numpy>=1.26.0
Requires-Dist: urllib3>=2.8.0
Provides-Extra: local-models
Requires-Dist: sentence-transformers>=5.0.0; extra == "local-models"
Provides-Extra: pgvector
Requires-Dist: psycopg2-binary>=2.9.9.1; extra == "pgvector"
Requires-Dist: pgvector>=0.4.0; extra == "pgvector"
Provides-Extra: redis
Requires-Dist: redis>=5.0.0; extra == "redis"
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3.0; extra == "langchain"
Provides-Extra: llamaindex
Requires-Dist: llama-index-core>=0.13.0; extra == "llamaindex"
Provides-Extra: all
Requires-Dist: sentence-transformers>=5.0.0; extra == "all"
Requires-Dist: psycopg2-binary>=2.9.9.1; extra == "all"
Requires-Dist: pgvector>=0.4.0; extra == "all"
Requires-Dist: langchain-core>=0.3.0; extra == "all"
Requires-Dist: llama-index-core>=0.13.0; extra == "all"
Requires-Dist: redis>=5.0.0; extra == "all"
Provides-Extra: dev
Requires-Dist: flake8>=7.0.0; extra == "dev"
Requires-Dist: mypy>=1.13.0; extra == "dev"
Requires-Dist: bandit>=1.8.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: types-requests>=2.32.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Synapse Memory Python SDK

Core Python SDK and algorithms for the Synapse Cognitive Memory substrate.

## Features

- **Encrypted SQLite Storage**: Fernet AES-128-CBC with HMAC-SHA256 authenticated encryption at rest.
- **Dynamic Programming Knapsack Packing**: Exact 0/1 Knapsack optimizer for packing high-relevance memories into strict token envelopes.
- **Ebbinghaus Decay Engine**: Continuous temporal decay with positive/negative reinforcement factors.
- **Semantic Deduplication**: Dual lexical Jaccard and dense cosine similarity detection to prevent node fragmentation.
- **Hybrid Retrieval**: BM25 sparse lexical ranking fused with dense vector embeddings via Reciprocal Rank Fusion (RRF).
- **Framework Integrations**: True drop-in adapters for LangChain (`BaseMemory`) and LlamaIndex (`BaseMemory`).

## Installation

```bash
pip install synapse-memory-engine          # from PyPI
# or, from a checkout of this repository:
pip install -e .
```

## Testing

```bash
python3 -m unittest discover -s tests
```
