Skip to content

gowthamchoudhary/memoryOS

Repository files navigation

MemoryOS

A contextual AI memory system. Not a bookmark manager — a memory operating system that preserves why things mattered.

Architecture

This is a TanStack Start full-stack React app (deployed on Cloudflare Workers via Lovable) plus an MV3 Chrome extension.

src/
  routes/                 React routes (login, register, _authenticated/*, api/extension/*)
  lib/
    hydradb.server.ts     HydraDB REST client — the core memory engine
    firecrawl.server.ts   URL scraping
    ai.server.ts          NIM MiniMax M2.7 + Groq llama-3.1-8b-instant
    memories.functions.ts saveMemory / recallCheck / chat / list / delete server functions
    tenant.functions.ts   HydraDB tenant provisioning
extension/                MV3 Chrome extension (floating orb, recall toast)
supabase/migrations/      Schema: profiles + memories with RLS

How it works

  1. Save — Firecrawl scrapes the URL → NIM extracts topics & semantic context → HydraDB stores the memory → Supabase keeps the metadata row.
  2. Recall — Groq turns the user's current context into a query → HydraDB recall_preferences returns related memories → the orb glows.
  3. Chat — User question → HydraDB recall_preferences + full_recall in parallel → NIM answers with cited memories.

HydraDB is the core memory engine. Supabase only holds auth and display metadata.

Secrets

  • HYDRADB_API_KEY
  • FIRECRAWL_API_KEY
  • NVIDIA_NIM_API_KEY (optional override: NVIDIA_NIM_BASE_URL, NVIDIA_NIM_MODEL)
  • GROQ_API_KEY (optional override: GROQ_MODEL)

Supabase URL / keys are auto-provisioned by Lovable Cloud.

Extension

See extension/README.md.

Semantic Reprocessing

Existing memories can be re-ingested into HydraDB using the graph-friendly packet format:

bun run reprocess:memories

The script is dry-run by default and logs extracted entities, normalized anchors, triplets, graph packet previews, and reuse metrics. To actually replace old HydraDB entries, run:

bun run reprocess:memories -- --commit

In commit mode, the script deletes each old hydradb_memory_id before re-upserting the improved semantic packet, then updates Supabase with the new HydraDB id. Use --limit 10 or --user-id <uuid> for focused runs.

For larger runs, the script retries AI rate limits and waits between memories by default. Tune this with --delay-ms 3000 if your provider rate limit is tight.

About

Context-aware memory resurfacing for the internet. MemoryOS captures why you saved content and intelligently resurfaces the right memory when it becomes relevant again.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages