Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MNEMO

MNEMO

Your second brain β€” that lives entirely on your machine.

A private, local-first personal knowledge graph and AI companion. Feed it what you read, write, think, and capture. It weaves everything into a living graph, learns how you think, and reasons in your voice β€” with nothing ever leaving your device.


License: MIT Local-first No API keys TypeScript Next.js 15 PRs welcome

Postgres + pgvector Β· Drizzle Β· local MiniLM embeddings Β· Ollama (or any OpenAI-compatible LLM) Β· Tailwind v4 Β· MCP


MNEMO β€” the knowledge graph view

Your knowledge, connected β€” the graph view (shown with a demo brain).


Note

This repo is the shell, not a brain. You clone it and it becomes yours β€” your notes, your graph, your voice β€” all stored and reasoned over on your own hardware. There is no hosted version, no account, no telemetry. The maintainer's brain stays on the maintainer's Mac.

Why MNEMO?

Note apps store text. MNEMO builds a mind.

  • 🧠 A real knowledge graph, not a pile of notes. Everything you feed it is distilled into typed atoms β€” beliefs, goals, traits, people, places, ideas β€” connected by typed, weighted, reasoned edges (supports, contradicts, influenced_by…). It reasons across your knowledge, not just searches it.
  • πŸ”’ Private by architecture. Embeddings run locally. The LLM runs locally (Ollama). Private notes are encrypted at rest. When the model is on your machine, MNEMO can safely learn from your most personal material β€” because it physically cannot leave.
  • πŸͺž It learns how you think. A self-model ("who you are" + "how you reason") is rebuilt nightly from your own words, so the agent answers in your voice and weighs trade-offs the way you do.
  • πŸŒ™ It optimizes itself while you sleep. Nightly it de-duplicates, re-weights what matters, surfaces contradictions, and sharpens its model of you. The graph gets cleaner as it grows, not noisier.
  • πŸ†“ Free to run forever. Local embeddings + a local model = no per-token bill, no rate limits, no quota. Bring a cloud key only if you want a bigger model.
  • 🀲 Senses & hands. Connect Gmail, Calendar, Notion, GitHub. It reads freely; anything it wants to do is proposed for your one-tap approval β€” never done silently.

MNEMO β€” the Ask / companion view
Ask anything β€” it answers in your voice, grounded in your own beliefs (owner-asserted outranks inferred). The mark is an β€œM” drawn as a memory-graph: nodes, edges, and a hub β€” the self everything connects to.

✨ Features

🧩 Knowledge graph 20 node types, 16 edge types, hybrid search (keyword + semantic, re-ranked by salience & recency)
πŸ’¬ Agent companion A tool-using agent that reasons step-by-step, grounds every claim in your graph, and verifies its own draft before answering
⏰ Automations Owner-defined recurring tasks ("every morning, research X and tie it to my notes") that run on schedule and land in your inbox
πŸ”¬ Deep research An async, multi-round investigation: grounds in what you know β†’ plans sub-questions β†’ gathers the web β†’ a cited brief tied back to your graph
πŸ“Έ Vision Drop in photos β€” it understands them, links the people/places, and recognises recurring faces across your library
πŸŽ™οΈ Private voice On-device speech-to-text (whisper.cpp) and text-to-speech read-aloud β€” voice in and out, nothing hits a cloud service
πŸ“₯ Ingest anything Notes, articles, PDFs, Readwise, Pocket, Notion, X archive, browser history, WhatsApp/Takeout exports β€” distilled, signal kept, noise dropped
🌐 Connectors Gmail Β· Calendar Β· Notion Β· GitHub β€” read freely, act only with approval
πŸ”„ Self-optimizing Nightly consolidation, contradiction detection, salience reconciliation, persona rebuild
πŸ““ Obsidian / markdown vault Two-way folder sync: your notes ingest into the brain; the graph exports as linked markdown ([[wikilinks]]) you can browse in Obsidian
🩺 Health dashboard Live system panel (DB, model, worker, queues, backups, disk) with a status dot in the top bar and one-click fixes
πŸ“± Everywhere Installable PWA, offline graph + search, Siri Shortcuts, MCP server for any MCP client
πŸ’Ύ Yours to keep One-command encrypted backups + restore. Your brain is never locked in

πŸ—οΈ How it works

   capture / connectors / photos / voice
                  β”‚
                  β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  INGEST  acquire β†’ chunk β†’    β”‚   local MiniLM embeddings (384-d)
   β”‚  embed β†’ extract β†’ link       β”‚   typed atoms + reasoned edges
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
        ╔════════════════════╗
        β•‘   KNOWLEDGE GRAPH  β•‘   Postgres + pgvector + pg_trgm
        β•‘  nodes ◄──edges──► β•‘   hybrid search, versioned beliefs
        β•šβ•β•β•β•β•β•β•β•β•β•¦β•β•β•β•β•β•β•β•β•β•β•
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό                    β–Ό
   NIGHTLY SYNTHESIS     AGENT  (reason β†’ tools β†’ reflect β†’ answer)
   dedupe Β· contradictions   grounded in YOU, in your voice
   salience Β· persona        reads free Β· acts on approval
        β”‚                    β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
        Ask Β· Graph Β· Digest Β· Siri Β· MCP

The data model and design rationale live in docs/PLAN.md.

πŸš€ Quickstart

Prerequisites: Node β‰₯ 20 Β· pnpm (corepack enable) Β· Postgres 16 (+ pgvector) Β· Ollama for the local model.

git clone https://github.com/0-uddeshya-0/mnemo.git
cd mnemo
pnpm install

# 1) configure
cp .env.example .env
#    set MNEMOSYNE_PASSWORD and a 32+ char SESSION_SECRET
#    point DATABASE_URL at your Postgres

# 2) local model (private + free, no keys)
ollama pull qwen2.5:7b           # text / reasoning
ollama pull qwen2.5vl:7b         # vision (optional)
#    in .env:  OPENROUTER_BASE_URL=http://localhost:11434/v1
#              LLM_MODEL=qwen2.5:7b

# 3) database
pnpm db:migrate                  # extensions, tables, HNSW + full-text indexes
pnpm db:seed                     # a small demo brain so the UI isn't empty

# 4) run
pnpm --filter @mnemosyne/web dev      # β†’ http://localhost:3000
pnpm --filter @mnemosyne/web worker   # ingest + nightly synthesis + digest

Open http://localhost:3000, set your password, and start feeding your mind. Full setup (production launchd services, Tailscale access, Siri, connectors) is in SETUP.md.

Prefer a cloud model? Leave OPENROUTER_BASE_URL at OpenRouter and set OPENROUTER_API_KEY β€” any OpenAI-compatible endpoint works. Private content stays walled off automatically whenever a cloud model is active.

πŸ” Privacy model

Layer Guarantee
Embeddings Computed locally (transformers.js). Never sent anywhere.
LLM Runs on your machine via Ollama by default.
Private notes Encrypted at rest (AES-256-GCM, key derived from your password).
Cloud opt-in If you switch to a cloud model, private content is automatically excluded.
Backups Stored locally, 0700, encrypted bodies preserved.
Telemetry None. There is no server to phone home to.

πŸ—ΊοΈ Roadmap

  • Face-embedding recognition (beyond appearance clustering)
  • Richer in-app graph editing & merge review
  • Native iOS app via App Intents
  • Pluggable model profiles (fast interactive vs. deep nightly)
  • More connectors

πŸ› οΈ Tech stack

Next.js 15 (App Router, RSC, server actions) Β· React 19 Β· TypeScript (strict) Β· Postgres 16 + pgvector + pg_trgm Β· Drizzle ORM Β· pg-boss queues Β· transformers.js (local MiniLM) Β· Ollama / any OpenAI-compatible LLM Β· whisper.cpp Β· Tailwind v4 + shadcn/ui Β· Model Context Protocol SDK.

🀝 Contributing

Issues and PRs are welcome. This is a personal-AI shell meant to be forked and made your own β€” fork it, make it yours, and send back anything that would help the next person.

πŸ“œ License

MIT β€” do what you like, keep the copyright notice. Your data is yours; this code is everyone's.


Built to remember, so you're free to think.

About

Your second brain β€” a private, local-first personal knowledge graph & AI companion that runs entirely on your machine. πŸ§ πŸ”’

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages