🧠 Cortex Memory SDK
The Smart Context Layer for Prompt Chains in LLMs
Built by Vaishakh Vipin
Overview
Cortex Memory SDK is an enterprise-grade context-aware AI system that provides intelligent memory management for Large Language Models (LLMs). It combines semantic understanding with self-evolving patterns to deliver the most relevant context for your AI applications.
🚀 Key Features
- Semantic Context Matching: Redis-backed semantic search using sentence transformers
- Self-Evolving Patterns: Advanced statistical pattern recognition for context relevance
- Multi-LLM Support: Seamless integration with Gemini, Claude, and OpenAI
- Hybrid Context Mode: Combines semantic and self-evolving context for optimal results
- Adaptive Context Selection: Automatically chooses the best context method
- Auto-Pruning System: Intelligently manages memory storage and cleanup
- Semantic Drift Detection: Monitors and adapts to changing conversation patterns
🛠️ Installation
pip install cortex-memory-sdk
📖 Quick Start
from cortex_memory import CortexClient
# Initialize the client
client = CortexClient(api_key="your_api_key")
# Generate context-aware responses
response = client.generate_with_context(
user_id="user123",
prompt="What did we discuss about AI yesterday?",
provider="gemini" # or "claude", "openai", "auto"
)
print(response)
🔧 Advanced Usage
Hybrid Context Mode
from cortex_memory.context_manager import generate_with_hybrid_context
response = generate_with_hybrid_context(
user_id="user123",
prompt="Explain the latest developments in AI",
provider="claude"
)
Adaptive Context Selection
from cortex_memory.context_manager import generate_with_adaptive_context
response = generate_with_adaptive_context(
user_id="user123",
prompt="What are the key points from our previous meetings?",
provider="auto" # Automatically selects best provider
)
🏗️ Architecture
- Redis: High-performance memory storage with semantic embeddings
- Sentence Transformers: Dense vector embeddings for semantic similarity
- Statistical Pattern Recognition: Robust algorithms for context scoring
- Multi-Provider LLM Integration: Unified interface for all major LLM providers
📊 Performance
- Fast Retrieval: Redis-pipelined operations for sub-second context retrieval
- Efficient Storage: Optimized embedding storage and compression
- Scalable: Designed for enterprise-scale deployments
- Cost-Effective: Intelligent context selection reduces token usage
🔒 Security
- API key authentication
- Rate limiting and usage tracking
- Secure Redis connections
- Privacy-focused design
📚 Documentation
For detailed documentation, visit: GitHub Repository
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: vaishakh.obelisk@gmail.com
Built with ❤️ by Vaishakh Vipin
Transform your LLM applications with intelligent context management. 🧠✨
Metadata
Release files for cortex-memory-sdk 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cortex_memory_sdk-2.0.3.tar.gz | 53.2 kB | Without provenance | Details for cortex_memory_sdk-2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cortex_memory_sdk-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for cortex_memory_sdk-2.0.3-py3-none-any.whl |
Total release size: 100.8 kB
Release files / cortex_memory_sdk-2.0.3.tar.gz
| Download URL | cortex_memory_sdk-2.0.3.tar.gz |
|---|---|
| Size | 53.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
736b2ae8eea2cf84f1117b420eb04186aa41c57882af60b9b0f142a5deb7e169
|
|
BLAKE2b-256 checksum How to use checksums |
05733d2aed27275831614b3528c98ccb26565b2793bd04aaf8005aafc81fe570
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / cortex_memory_sdk-2.0.3-py3-none-any.whl
| Download URL | cortex_memory_sdk-2.0.3-py3-none-any.whl |
|---|---|
| Size | 47.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c2c4883e4df1bac72640611a215ea78319aa02ba1ae8e6bdea86c0f496d1760
|
|
BLAKE2b-256 checksum How to use checksums |
4ba4c6bb4ea00a9297925eb89e1ea8c16fbcf897cd7110b68216f399702a391e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Security for cortex-memory-sdk 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.