{"name":"Memori: SQL Native Memory Layer for LLMs and AI Agents","description":"Memori is an SQL Native Memory Layer designed for LLMs, AI Agents, and Multi-Agent Systems. It provides a robust and flexible solution for managing long-short term memory, integrating seamlessly with existing software and infrastructure. This project aims to enhance AI systems with persistent, structured memory capabilities, making them more intelligent and context-aware.","github":"https://github.com/GibsonAI/memori","url":"https://osrepos.com/repo/gibsonai-memori","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/gibsonai-memori","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/gibsonai-memori.md","json":"https://osrepos.com/repo/gibsonai-memori.json","topics":["AI","LLM","AI Agents","Memory Management","Python","RAG","Database","State Management"],"keywords":["AI","LLM","AI Agents","Memory Management","Python","RAG","Database","State Management"],"stars":null,"summary":"Memori is an SQL Native Memory Layer designed for LLMs, AI Agents, and Multi-Agent Systems. It provides a robust and flexible solution for managing long-short term memory, integrating seamlessly with existing software and infrastructure. This project aims to enhance AI systems with persistent, structured memory capabilities, making them more intelligent and context-aware.","content":"## Introduction\n\nMemori, developed by MemoriLabs, is an SQL Native Memory Layer for LLMs, AI Agents, and Multi-Agent Systems. It serves as the memory fabric for enterprise AI, designed to plug into the software and infrastructure you already use. Memori is LLM, datastore, and framework agnostic, ensuring seamless integration into your existing architecture. It enhances AI interactions by providing structured, persistent memory, including vectorized memories, in-memory semantic search, and a third normal form schema for a knowledge graph.\n\n## Installation\n\nGetting started with Memori is straightforward. You can install it using pip:\n\nbash\npip install memori\n\n\nFor an optimized environment, it's suggested to run the setup command once:\n\nbash\npython -m memori setup\n\n\nThis prepares your environment for faster execution, though Memori will perform this step automatically on its first run if not done manually.\n\n## Examples\n\nHere's a quickstart example demonstrating how to use Memori with OpenAI to manage conversational memory:\n\npython\nimport os\nimport sqlite3\n\nfrom memori import Memori\nfrom openai import OpenAI\n\n\ndef get_sqlite_connection():\n    return sqlite3.connect(\"memori.db\")\n\n\nclient = OpenAI(api_key=os.getenv(\"OPENAI_API_KEY\"))\n\nmemori = Memori(conn=get_sqlite_connection).llm.register(client)\nmemori.attribution(entity_id=\"123456\", process_id=\"test-ai-agent\")\nmemori.config.storage.build()\n\nresponse = client.chat.completions.create(\n    model=\"gpt-4.1-mini\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"My favorite color is blue.\"}\n    ]\n)\nprint(response.choices[0].message.content + \"\\n\")\n\n# Advanced Augmentation runs asynchronously to efficiently\n# create memories. For this example, a short lived command\n# line program, we need to wait for it to finish.\n\nmemori.augmentation.wait()\n\n# Memori stored that your favorite color is blue in SQLite.\n# Now reset everything so there's no prior context.\n\nclient = OpenAI(api_key=os.getenv(\"OPENAI_API_KEY\"))\n\nmemori = Memori(conn=get_sqlite_connection).llm.register(client)\nmemori.attribution(entity_id=\"123456\", process_id=\"test-ai-agent\")\n\nresponse = client.chat.completions.create(\n    model=\"gpt-4.1-mini\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"What's my favorite color?\"}\n    ]\n)\nprint(response.choices[0].message.content + \"\\n\")\n\n\nYou can also explore the stored memories directly using SQLite:\n\nbash\n/bin/echo \"select * from memori_conversation_message\" | /usr/bin/sqlite3 memori.db\n/bin/echo \"select * from memori_entity_fact\" | /usr/bin/sqlite3 memori.db\n/bin/echo \"select * from memori_process_attribute\" | /usr/bin/sqlite3 memori.db\n/bin/echo \"select * from memori_knowledge_graph\" | /usr/bin/sqlite3 memori.db\n\n\n## Why Use Memori?\n\nMemori offers a powerful and flexible solution for integrating memory into your AI applications. Key advantages include:\n\n*   **LLM and Datastore Agnostic**: Supports all major foundational models (Anthropic, Bedrock, Gemini, Grok, OpenAI) and a wide range of databases (DB API 2.0, Django, SQLAlchemy, CockroachDB, MariaDB, MongoDB, MySQL, Neon, Oracle, PostgreSQL, SQLite, Supabase).\n*   **Advanced Augmentation**: Significant performance improvements with threaded, zero-latency memory extraction and enhancement, enriching memories with attributes, events, facts, people, preferences, relationships, rules, and skills.\n*   **Structured Memory**: Utilizes vectorized memories and in-memory semantic search for more accurate context, alongside a third normal form schema for a robust knowledge graph.\n*   **Reduced Development Overhead**: Simplifies integration with a single line of code for core memory functionalities.\n*   **Attribution and Session Management**: Provides mechanisms to attribute LLM interactions to specific entities and processes, and manage sessions for coherent conversational flows.\n*   **Developer-Friendly**: Advanced Augmentation is always free for developers, with a CLI for easy management and quota checking.\n\n## Links\n\n*   **GitHub Repository**: <a href=\"https://github.com/MemoriLabs/Memori\" target=\"_blank\">https://github.com/MemoriLabs/Memori</a>\n*   **Documentation**: <a href=\"https://memorilabs.ai/docs\" target=\"_blank\">https://memorilabs.ai/docs</a>\n*   **Discord**: <a href=\"https://discord.gg/abD4eGym6v\" target=\"_blank\">https://discord.gg/abD4eGym6v</a>\n*   **Memori Cookbook**: <a href=\"https://github.com/MemoriLabs/memori-cookbook\" target=\"_blank\">https://github.com/MemoriLabs/memori-cookbook</a>\n*   **Contributing Guidelines**: <a href=\"https://github.com/MemoriLabs/Memori/blob/main/CONTRIBUTING.md\" target=\"_blank\">https://github.com/MemoriLabs/Memori/blob/main/CONTRIBUTING.md</a>","metrics":{"detailViews":5,"githubClicks":3},"dates":{"published":null,"modified":"2025-12-28T00:01:00.000Z"}}