Skip to main content

🧠 Memorix AI

PyPI version Python versions License CI Codecov

A flexible memory management system for AI applications with plug-in support for various vector stores and embedding models.

✨ Features

  • 🗄️ Flexible Vector Stores: FAISS, Qdrant, and custom implementations
  • 🤖 Multiple Embedding Models: OpenAI, Google Gemini, Sentence Transformers
  • 📊 Metadata Management: Optional metadata storage with multiple backends
  • ⚙️ YAML Configuration: Easy configuration management
  • 🚀 Simple API: Clean and intuitive interface
  • 🧪 Comprehensive Testing: Full test coverage and CI/CD
  • 📚 Rich Documentation: API docs, examples, and guides

🚀 Quick Start

Installation

pip install memorix-ai

Basic Usage

from memorix import MemoryAPI, Config

# Initialize with configuration
config = Config('memorix.yaml')
memory = MemoryAPI(config)

# Store a memory
memory_id = memory.store(
    "Python is a high-level programming language.",
    metadata={"topic": "programming", "language": "python"}
)

# Retrieve relevant memories
results = memory.retrieve("programming languages", top_k=5)
for result in results:
    print(f"Content: {result['content']}")
    print(f"Similarity: {result['similarity']:.3f}")
    print(f"Metadata: {result['metadata']}")

⚙️ Configuration

Create a memorix.yaml file:

vector_store:
  type: faiss
  index_path: ./memorix_index
  dimension: 1536

embedder:
  type: openai
  model: text-embedding-ada-002
  api_key: ${OPENAI_API_KEY}

metadata_store:
  type: sqlite
  database_path: ./memorix_metadata.db

settings:
  max_memories: 10000
  similarity_threshold: 0.7

🔌 Supported Components

Vector Stores

  • FAISS: Fast similarity search with CPU/GPU support
  • Qdrant: Vector database with advanced features
  • Custom: Implement your own vector store

Embedding Models

  • OpenAI: text-embedding-ada-002, text-embedding-3-small, etc.
  • Google Gemini: models/embedding-001
  • Sentence Transformers: all-MiniLM-L6-v2, all-mpnet-base-v2, etc.

Metadata Stores

  • SQLite: Persistent storage with SQL database
  • In-Memory: Fast temporary storage
  • JSON File: Simple file-based storage

📖 API Reference

MemoryAPI

Method Description
store(content, metadata=None) Store content with optional metadata
retrieve(query, top_k=5) Retrieve relevant memories based on query
update(memory_id, content, metadata=None) Update an existing memory
delete(memory_id) Delete a memory by ID
list_memories(limit=100) List all memories with basic info

🎯 Examples

Core Examples

See the examples/ directory for basic usage examples:

  • basic_usage.py: Minimal usage example

🚀 Comprehensive Examples & Demos

For comprehensive examples, interactive demos, and real-world applications, check out our dedicated examples repository:

📚 Memorix Examples Repository

Featured Demos:

Interactive Applications:

Ready-to-Use Templates:

Quick Start:

# Clone the examples repository
git clone https://github.com/memorix-ai/memorix-examples.git
cd memorix-examples

# Install dependencies
pip install -r requirements.txt

# Run a demo
python demos/01_basic_usage.py

🛠️ Development

Setup

# Clone the repository
git clone https://github.com/memorix-ai/memorix-sdk.git
cd memorix-sdk

# Install in development mode
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

Common Commands

# Run tests
make test

# Run tests with coverage
make test-cov

# Format code
make format

# Run linting
make lint

# Build package
make build

# See all available commands
make help

Running Tests

python -m pytest tests/

Running Examples

python examples/basic_usage.py

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

🗺️ Roadmap

  • Add more vector store backends (Pinecone, Weaviate, etc.)
  • Add more embedding models (Cohere, Hugging Face, etc.)
  • Add memory compression and summarization
  • Add batch operations
  • Add memory versioning
  • Add memory expiration
  • Add memory categories and tags
  • Add memory search filters
  • Add memory export/import
  • Add memory analytics and insights

📚 Documentation

📞 Support


Made with ❤️ by the Memorix Team

GitHub stars GitHub forks

Metadata

Release files for memorix-ai 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memorix-ai 0.1.1
File Size Uploaded
memorix_ai-0.1.1.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for memorix-ai 0.1.1
File Interpreter ABI Platform
memorix_ai-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / memorix_ai-0.1.1.tar.gz

Download URL memorix_ai-0.1.1.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d3ed7f5cf43786a0aa3a9ecf41da138adbf5fc741541983f57bddd8aad6cc30f
BLAKE2b-256 checksum
How to use checksums
baf29b6a64bbef00d853803a479b1af653c05c0861d5b328aa7fcae102340b62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / memorix_ai-0.1.1-py3-none-any.whl

Download URL memorix_ai-0.1.1-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
247e02fbf853996c9a51795740f7030ec3ca2bf0c28f6aa5baec0e380ecdac89
BLAKE2b-256 checksum
How to use checksums
b1fcb56b0a9434a9c11e7439ae4d049be3c9c5a52fdd37fa9420e8e8c3e4a0ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page