Skip to main content

Memory‑OS 🧠

PyPI version License: MIT Python Version

Memory‑OS is a local Personal Knowledge Operating System that automatically syncs, indexes, and retrieves information across your GitHub repositories, Gmail inbox messages, and Notion workspaces.

It provides both a command-line interface (CLI) and an interactive Terminal User Interface (TUI) powered by Hybrid RAG (Keyword + Vector + Knowledge Graph), local embeddings via SentenceTransformers, and ultra-fast LLM generation via the Groq API.


✨ Features

  • 🌐 Multi-Source Ingestion: Sync repositories, issues, PRs, emails, and Notion pages via Composio OAuth connectors.
  • ⚡ Hybrid RAG Retrieval: Combines SQLite (Keyword & Full-Text Search), Qdrant (Vector Similarity Search), and Neo4j / SQLite Graph (Knowledge Graph relationship lookups).
  • 🤖 Groq LLM Integration: Uses Groq's high-speed LLM inference (llama-3.3-70b-versatile, llama-3.1-8b-instant) with streaming responses.
  • 🎨 Interactive Terminal User Interface (TUI): Beautiful full-screen terminal app built with Textual, featuring chat streaming, live diagnostics, and sidebar navigation.
  • 🛡️ Robust Offline Fallbacks: Gracefully degrades to local SQLite storage and local SQLite Graph when Docker database services or Neo4j are offline.
  • 📁 Multi-Profile Workspaces: Easily create, list, and switch between separate knowledge profile contexts.
  • 📦 Portability: Export and import complete knowledge bases into single compressed archive files.

🏗️ Architecture

flowchart TD
    subgraph Ingestion [1. Ingestion Layer]
        GH[GitHub Repos & Docs]
        GM[Gmail Inbox Messages]
        NT[Notion Page Contents]
        CP[Composio Integration Platform]
        GH --> CP
        GM --> CP
        NT --> CP
    end

    subgraph Storage [2. Multi-Model Storage Layer]
        DB[(SQLite: workspace.db)]
        QD[(Qdrant Vector DB)]
        N4J[(Neo4j Graph Database)]
        SQL_G[(SQLite Graph Fallback)]
        
        CP -->|Metadata & Docs| DB
        DB -->|Text Chunks| CH[Chunking Core]
        CH -->|Embeddings| EM["SentenceTransformer (all-MiniLM-L6-v2)"]
        EM -->|384d Vectors| QD
        
        DB -->|Graph Construction| N4J
        DB -->|Graph Construction| SQL_G
    end

    subgraph Retrieval [3. Hybrid RAG Layer]
        HS[Hybrid Search Router]
        QD -->|Vector Cosine Similarity| HS
        DB -->|FTS Keyword Matching| HS
        N4J -->|Graph Relationship Lookups| HS
        SQL_G -->|Graph Fallback Lookups| HS
        
        HR[Hybrid Ranker & Scorer]
        HS --> HR
        
        RAG[RAG Context Builder]
        HR -->|Merged Context| RAG
        
        LLM["Groq LLM Engine (Llama 3 Stream)"]
        RAG -->|Prompt Assembly| LLM
    end

    subgraph Interface [4. Interface Layer]
        TUI[Terminal User Interface App]
        CLI[Memory-OS CLI Commands]
        
        TUI -->|Search/Chat Queries| Retrieval
        CLI -->|Admin/Sync Commands| Ingestion
        CLI -->|Query Command| Retrieval
        LLM -->|Streamed Answer| TUI
        LLM -->|Formatted Output| CLI
    end

📦 Installation & Quick Start

1. Install via PyPI

pip install --upgrade cli-memory-os

2. Run the Onboarding Wizard

Initialize your workspace, set up database storage, configure API keys (Groq & Composio), and authorize connectors:

memory-os init

3. Sync Your Data

Import your documents, emails, and repositories:

memory-os sync

4. Ask Questions or Launch the Interactive TUI

Ask a quick question from the terminal:

memory-os ask "What was discussed in my latest emails about project deployment?"

Or launch the full interactive terminal application:

memory-os

🖥️ Interactive Terminal Application (TUI)

Launch the full-screen terminal interface by running memory-os without arguments.

Features of the TUI:

  • 💬 Chat Panel: Ask questions with real-time token streaming and expandable source citations.
  • 📊 Overview Dashboard: Monitor total indexed repositories, documents, emails, vectors, and active model configs.
  • 🩺 Diagnostics Panel: Run line-by-line connection health checks for local databases, LLM APIs, and connectors.
  • ⚙️ Config Manager: View and inspect active TOML configuration settings.

🗄️ Database Strategy

Memory-OS employs a multi-model storage strategy:

Engine Role & Rationale
SQLite (workspace.db) Primary structured storage for document chunks, metadata, and full-text keyword indexing with fast ACID transactions.
Qdrant High-performance vector database storing 384-dimensional dense vector embeddings generated locally by all-MiniLM-L6-v2.
Neo4j / SQLite Graph Native property graph for mapping relationships (Repository-[USES]->Technology or Email-[SENT_BY]->User). Seamlessly falls back to a relational SQLite graph schema when Neo4j is offline.

🚀 CLI Commands Reference

Category Command Description
App & TUI memory-os Launches the interactive terminal user interface.
Setup & Core memory-os init Guided onboarding wizard for dependencies, Docker, API keys, and connectors.
memory-os start Starts background Docker Compose database services (Neo4j, Qdrant).
memory-os stop Stops background Docker Compose database services.
memory-os restart Restarts database services.
Operations memory-os sync [--source SOURCE] [--rebuild] Incremental or full data synchronization from GitHub, Gmail, or Notion.
memory-os ask <question> Queries the knowledge base using the Hybrid RAG engine.
Diagnostics memory-os doctor Comprehensive health check across Python, Docker, databases, LLMs, and API keys.
memory-os status Displays indexed counts (repos, docs, emails, vectors, embedding models).
memory-os monitor Aggregates log metrics (indexing speeds, search rates, LLM response latencies).
memory-os benchmark Runs performance benchmarks across keyword, vector, hybrid, and RAG pipelines.
memory-os logs [--tail N] Views system logs with rotation support.
Config & Workspace memory-os config show|get|set|reset Inspects, modifies, or resets settings in ~/.memory-os/config.toml.
memory-os workspace list|create|switch|delete|info Manages multiple isolated workspace profile directories.
memory-os export <file.zip> Compresses active workspace databases and configuration into a backup file.
memory-os import <file.zip> Restores a workspace profile from a backup zip archive.
memory-os plugins Lists all registered integration connector plugins.
memory-os version Displays installed package and system version information.

🔌 Plugin Connector Architecture

Every connector inherits from BaseConnector (connectors/base.py) and registers via @register (connectors/registry.py):

from connectors.base import BaseConnector
from connectors.registry import register

@register
class SlackConnector(BaseConnector):
    name = "Slack"
    slug = "slack"

    def authenticate(self) -> bool:
        # Perform OAuth or API validation
        return True

    def sync(self) -> dict:
        # Fetch messages and documents
        return {"synced": 42}

    def health(self) -> tuple[bool, str]:
        return True, "Connected"

🛠️ Configuration & Customization

Settings are managed under ~/.memory-os/config.toml:

[groq]
api_key = "gsk_..."
model = "llama-3.3-70b-versatile"

[composio]
api_key = "ak_..."

[vector]
provider = "qdrant"
host = "localhost"
port = 6333
embedding_model = "sentence-transformers/all-MiniLM-L6-v2"

To update settings directly from the terminal:

memory-os config set groq.model llama-3.1-8b-instant

🚀 CI/CD & Automated PyPI Releases

Memory-OS includes a complete GitHub Actions CI/CD pipeline (.github/workflows/ci-cd.yml).

Automated Workflow Actions:

  1. Automated Testing: Runs pytest on every push and pull_request to main.
  2. Automated PyPI Deployment: Automatically builds wheels and pushes the updated version to PyPI when changes are pushed to main or a new version tag (e.g. v0.1.16) is released.

Setup Instructions for PyPI Releases:

  1. Option A: PyPI Trusted Publisher (Recommended / OIDC):
    • Go to PyPI Account Settings -> Publishers.
    • Add GitHub Publisher: Owner: anirudh-pedro (or your GitHub org/username), Repository: Memory-OS, Workflow name: ci-cd.yml.
  2. Option B: GitHub Secret:
    • Create a PyPI API Token on PyPI Tokens.
    • In GitHub Repository -> Settings -> Secrets and variables -> Actions, add a repository secret named PYPI_API_TOKEN.

To release a new version:

  1. Update version = "0.1.X" in pyproject.toml.
  2. Commit and push to main (or push a tag git tag v0.1.X && git push origin v0.1.X).
  3. GitHub Actions will run tests, build artifacts, and deploy to PyPI automatically.

📜 License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli_memory_os-0.1.17.tar.gz (87.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_memory_os-0.1.17-py3-none-any.whl (88.3 kB view details)

Uploaded Python 3

File details

Details for the file cli_memory_os-0.1.17.tar.gz.

File metadata

  • Download URL: cli_memory_os-0.1.17.tar.gz
  • Upload date:
  • Size: 87.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for cli_memory_os-0.1.17.tar.gz
Algorithm Hash digest
SHA256 c80418b30290f8688041a70ce7d87579f70093bb7ecbbffcb22bdc26ac1c6434
MD5 a4db8375f27165d208a1e9147b04ca1d
BLAKE2b-256 1f97275ed620ddf062d95376e90de5947efc113255ad64425943dd2fb2bf40b7

See more details on using hashes here.

File details

Details for the file cli_memory_os-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: cli_memory_os-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 88.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for cli_memory_os-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 6bbdde3da40c5162ca3cd358176fc688bf486382a655881a389c3116a9c475e0
MD5 0e0d7932de14158b058bb90436c982dd
BLAKE2b-256 6b7858babec35588cbbc670cf5a42f066bc82dd95b0f70dc8d72fe9343047d12

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.17 This release

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.0

2 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