u/snozberryface

▲ 7 r/mcp

Built an MCP server that gives coding agents persistent memory across sessions. Open source, written in Go, ships as one static binary.

The problem it solves:

Coding agents (Claude Code, Cursor, Codex, Windsurf) reset every session. Conventions, corrections, architectural decisions all evaporate. Mnemos persists them and pushes a ranked, token-budgeted context block back at session start so the next session begins already aware of what the last one learned.

Tool surface (20+ tools):

  • mnemos_session_start / mnemos_session_end — opens a session, returns prewarm context (conventions, recent sessions, matching skills, corrections, hot files)
  • mnemos_save / mnemos_search / mnemos_get — observation CRUD with hybrid retrieval (BM25 + cosine via RRF)
  • mnemos_correct — structured tried / wrong_because / fix corrections, retrieval-boosted
  • mnemos_convention — durable rules with provenance
  • mnemos_skill_save / mnemos_skill_match / mnemos_skill_score — skill registry
  • mnemos_ruminate_* — adversarial review of stale skills with falsifiability gating
  • mnemos_context — compaction recovery, restores goal and decisions when the agent's context gets compacted mid-session
  • mnemos_promote, mnemos_link, mnemos_touch, mnemos_stats, mnemos_delete

Design decisions worth mentioning here:

  • Built on the official Go MCP SDK. I hand-rolled JSON-RPC first and lost hours before the official SDK made it redundant. Lesson learned.
  • Bi-temporal store. Observations carry valid/invalid timestamps. Invalidation never deletes, so "we used to use X, now Y" stays queryable without poisoning retrieval. Explicit Go timestamps because CURRENT_TIMESTAMP is second-precision and bi-temporal After() queries collide when events land in the same second.
  • Prompt-injection scanner at the write boundary. Memory stores are a new attack surface. Any tool that writes observations can plant instruction overrides, zero-width unicode, bidi overrides, or MCP spoofing into next session's context. Mnemos sanitises low-risk content and wraps high-risk content in a visible [MNEMOS: FLAGGED] banner before it reaches the model.
  • Deterministic skill promotion. Three corrections clustered on (agent, project, topic) auto-promote into a skill with When this applies / Avoid / Do sections, synthesised by pattern-mining, not an LLM call. Idempotent via stable origin hash.
  • No globals, no init, no reflection. Testability and predictability.
  • SQLite + FTS5 for retrieval, optional cosine via Ollama. No vector DB.

Install:

curl -fsSL https://raw.githubusercontent.com/polyxmedia/mnemos/main/scripts/install.sh | bash mnemos init

mnemos init auto-registers with Claude Code, Claude Desktop, Cursor, Windsurf, Codex CLI by writing the right .mcp.json / settings entries.

15 MB binary, Linux/macOS/Windows, amd64 + arm64. MIT licensed, free, no paid tier.

GitHub: https://github.com/polyxmedia/mnemos

Happy to dig into any of the design choices, especially the bi-temporal model and the injection scanner since those felt the least obvious to get right.

u/snozberryface — 14 days ago
▲ 12 r/threejs

Spent the last few weeks turning a basic Three.js solar system into something more ambitious. Start at Earth, fly out, see the actual Milky Way around you procedurally generated from real galactic constants (Hernquist bulge, exponential disc, four arms with per-arm phase asymmetry, oblate halo, hash-based wisps for the dust lanes). Keep going and you reach a black hole that's actually doing Schwarzschild geodesic raymarching per pixel.

The black hole was the most fun part. RK4 integration of the Binet equation d²u/dφ² = -u + (3/2)u² over 220 steps per fragment, escape detection via linear interpolation at u = 0.005 so the exit phi stays continuous in b instead of jumping by step boundaries, that was the one thing that killed the visible concentric ring banding. Lensing samples the skybox at the deflected direction with anisotropic filtering so stretched stars stay clean. Photon ring brightening uses a physics-motivated exponential boost on impact parameter, so the thin bright ring you see in EHT images of M87* and Sgr A* falls out naturally from rays that orbit multiple times near b_crit = 3√3/2 r_s, no artistic Fresnel halo needed.

The galaxy uses GPU instancing for ~320k stars on desktop with separate density-modulated arm-glow sprites and halo sprites layered over the disc. Pattern-locked arm rotation so it doesn't visibly wind at high time-speed. Lots of iteration to stop it looking ribbony or too globey, ended up using per-arm pitch variation and hash-based noise for the wispy structure between arms.

Procedural Tone.js ambient music, GSAP cinematic transitions between bodies, WebXR support, and a fly mode if you wanna pilot through it. Whole thing also runs on Apple Vision Pro via WebXR.

Live at 3dsolarsystem.online if you wanna check it out, happy to answer anything about the shaders or the galaxy density model.

u/snozberryface — 22 days ago