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.2.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.2-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cortex_memory_sdk-2.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 852682e558bdb463e63a7d2eb0839fe517e82a293bd454d216add5e61f473b9a
MD5 eadda5bb61113c2965d1aba54370640b
BLAKE2b-256 f232ca909580973ada9b58f58af58f9c196c011026f2840d79e107273510c86d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cortex_memory_sdk-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3400ef7eb16fbf6526cdde36754539dd436e8f4b57dfda6f5bd732aff74876bd
MD5 035e560df918a57b52ce9b6df54172eb
BLAKE2b-256 88885a1b055ce2e101be8df95d2bb6b8ee9e3f4f881d58b1ad61a602ea7410d8

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