memoripy  by caspianmoon

Python library for AI memory layer in context-aware apps

Created 1 year ago
675 stars

Top 50.2% on SourcePulse

GitHubView on GitHub
Project Summary

Memoripy is a Python library for AI applications that require sophisticated memory management, offering short-term and long-term storage with features like semantic clustering and memory decay. It's designed for developers building context-aware AI agents and chatbots, enabling more natural and persistent conversational experiences.

How It Works

Memoripy manages memory through a MemoryManager class, leveraging separate short-term and long-term storage mechanisms. It uses embedding models (like OpenAI or Ollama) to represent interactions semantically. Retrieval is enhanced by hierarchical clustering and graph-based associations, allowing for concept extraction and spreading activation to find relevant memories. Memory decay and reinforcement mechanisms dynamically adjust the relevance of past interactions over time.

Quick Start & Requirements

  • Install via pip: pip install memoripy
  • Prerequisites: openai, faiss-cpu, numpy, networkx, scikit-learn, langchain, ollama.
  • Requires API keys for OpenAI or Ollama.
  • Example usage and detailed class descriptions are available in the README.

Highlighted Details

  • Supports multiple LLM providers: OpenAI, Azure OpenAI, OpenRouter, and Ollama.
  • Implements memory decay and reinforcement for dynamic relevance.
  • Utilizes graph-based associations and spreading activation for retrieval.
  • Offers hierarchical clustering for semantic grouping of memories.

Maintenance & Community

  • Open to contributions via issues and pull requests.
  • No specific community channels (Discord/Slack) or notable contributors are listed in the README.

Licensing & Compatibility

  • Licensed under the Apache 2.0 License.
  • Permissive license suitable for commercial use and integration into closed-source applications.

Limitations & Caveats

The provided example requires manual API key setup. While faiss-cpu is listed, performance with large memory stores might benefit from a GPU-enabled FAISS installation, which is not explicitly detailed. The project appears to be actively maintained with contributions welcome, but specific community support channels are not highlighted.

Health Check
Last Commit

11 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.