Observed since 21 Oct, 11:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Memory System for AI Conversations
Memory System for AI Conversations
AIMemo is a lightweight memory layer that enables AI agents to remember context across conversations. Build AI applications that truly understand and remember your users.
pip install aimemo
For PostgreSQL support:
pip install aimemo[postgres]
from aimemo import AIMemo
from openai import OpenAI
# Initialize AIMemo
aimemo = AIMemo()
aimemo.enable()
# Use OpenAI normally - memory is automatic!
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "I'm building a FastAPI project"}]
)
# Later conversation - context is automatically injected
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "How do I add authentication?"}]
)
# The model remembers your FastAPI project!
SQLite (default):
from aimemo import AIMemo
aimemo = AIMemo() # Uses aimemo.db by default
PostgreSQL:
from aimemo import AIMemo, PostgresStore
store = PostgresStore("postgresql://user:pass@localhost/aimemo")
aimemo = AIMemo(store=store)
export AIMEMO_DB_PATH="./my_memory.db"
export AIMEMO_MAX_CONTEXT=10
from aimemo import AIMemo
aimemo = AIMemo(namespace="user_123")
# Add memories manually
aimemo.add_memory(
content="User prefers dark mode",
tags=["preference", "ui"],
metadata={"priority": "high"}
)
# Search memories
results = aimemo.search("dark mode", limit=5)
# Get formatted context
context = aimemo.get_context("user interface preferences")
from aimemo import AIMemo
# Each user gets their own namespace
user_memory = AIMemo(namespace=f"user_{user_id}")
user_memory.enable()
# Memories are isolated per user
Check out the examples/ directory:
pip install pytest
pytest tests/
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black aimemo tests examples
Full documentation is available in the docs/ directory:
AIMemo
enable() - Start intercepting LLM callsdisable() - Stop interceptingadd_memory(content, metadata, tags) - Add memory manuallysearch(query, limit) - Search memoriesget_context(query, limit) - Get formatted contextclear(namespace) - Clear memoriesStorage Backends
SQLiteStore(db_path) - SQLite storagePostgresStore(connection_string) - PostgreSQL storageAIMemo works by intercepting LLM API calls:
All automatically, with zero code changes!
We love contributions! ❤️ AIMemo is an open-source project and we welcome contributions of all kinds:
git checkout -b feature/amazing-featurepytest tests/git commit -m 'Add amazing feature'git push origin feature/amazing-feature# Clone the repository
git clone https://github.com/gianghungtien/aimemo.git
cd aimemo
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black aimemo tests examples
First time contributing? Check out issues labeled good first issue to get started!
Thanks to all the amazing people who have contributed to AIMemo! 🙏
MIT License - see LICENSE file for details.
Need help? We're here for you!
If you find AIMemo helpful, please consider:
Built with ❤️ by Jason
⭐ Star on GitHub • 📖 Documentation • 🐛 Report Bug • 💡 Request Feature
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.1 | 22 Nov 2025 | 8 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1e3f95ba887b339c1bfcdf1de542a077b868c82c4bad8fa8a4815bbdbd0a90d0