Skip to main content

🧠 The Smart Context Layer for Prompt Chains in LLMs - Enterprise-grade context-aware AI system with semantic understanding and self-evolving memory. Built by Vaishakh Vipin (https://github.com/VaishakhVipin) - Advanced context management for LLMs with Redis-backed semantic search, self-evolving patterns, and multi-provider support (Gemini, Claude, OpenAI).

Project description

🧠 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


Built with ❤️ by Vaishakh Vipin

Transform your LLM applications with intelligent context management. 🧠✨

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

cortex_memory_sdk-2.0.1.tar.gz (53.2 kB view details)

Uploaded Source

Built Distribution

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

cortex_memory_sdk-2.0.1-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file cortex_memory_sdk-2.0.1.tar.gz.

File metadata

  • Download URL: cortex_memory_sdk-2.0.1.tar.gz
  • Upload date:
  • Size: 53.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for cortex_memory_sdk-2.0.1.tar.gz
Algorithm Hash digest
SHA256 a60956bc048d39b47f1c0ee603a9908be824f04528a64303862e788cf1790526
MD5 7609fbc06184fe098d9f67dc7a0f249e
BLAKE2b-256 c93341b6c70c6b47f89c2ac90dfd908edeee846c7116c578ce32793b90434245

See more details on using hashes here.

File details

Details for the file cortex_memory_sdk-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cortex_memory_sdk-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd7e0e299498a17d9793a644f77b8749b69c5c4cd6cc2f4687f2f393ae39b43b
MD5 9cd5d5810c0853611b635b4bc7060a44
BLAKE2b-256 72796e5945f1362191587dde50bab4fbb68ebdb2337bf0da85430669332cd7fd

See more details on using hashes here.

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