The Problem
LLMs are great at writing code, but they choke on anything too big. You feed them a giant repo or a months-long chat, and they start hallucinating or forget half the context. Most agent tools either give up, or pretend chunking is "good enough." It's not.
What This Does
Monolith wraps the Recursive Language Model (RLM) in actual infrastructure, so agents can handle huge contexts without melting down. The main logic lives in rlm/ and mcp-modal/, with the entry point at main.py or mcp-modal/server.py. It uses Modal serverless (see modalruntime.py) to run LLMs on demand, and persists context files in Modal Volumes ({threadid}/context.txt). The MCP server layer (stdio and Cloudflare Worker in mcp-modal/cloudflare/worker-gateway/) lets any MCP-compatible agent—like Claude Code—call the RLM as a tool.
Every session gets uploaded automatically (scripts/sessionendupload.sh), so the agent doesn't start from scratch. The REPL loop in rlm/rlmrepl.py lets the root LLM orchestrate sub-LLMs for chunked semantic analysis. All the glue is here: Python code for chunking, filtering, and delegating, with cheap models for grunt work and smarter ones for orchestration.
Real-World Use
Say you’re building a Claude Code bot that needs to answer questions about a 100k-line codebase. Your agent calls chatrlm_query() via the MCP server, passing the query and thread ID. The RLM reads the persistent context file, splits it up, and uses sub-LLMs to analyze relevant chunks. Answers get appended to the history, so next time your bot remembers what happened. You can even query or store context directly with CLI tools (python -m deeprecurse.query or store.py).
The Bottom Line
Monolith solves a real pain: letting agents reason over giant, persistent contexts, not just what's in the prompt. It’s overkill for tiny projects, but if you want recursive, stateful agents that don’t lose their memory, this is the infrastructure you need. The setup is fiddly, but the tradeoff is you get actual context accumulation—something most “AI agents” only pretend to do.