Aleph

Aleph is an MCP server and skill for
Recursive Language Models (RLMs). It keeps working state — search indexes,
code execution, evidence, recursion — in a Python process outside the prompt
window, so the LLM reasons iteratively over repos, logs, documents, and data
without burning context on raw content.
+-----------------+ tool calls +-----------------------------+
| LLM client | ---------------> | Aleph (Python process) |
| (context budget)| <--------------- | search / peek / exec / sub |
+-----------------+ small results +-----------------------------+
Why Aleph:
- Load once, reason many times. Data lives in Aleph memory, not the prompt.
- Compute server-side.
exec_python runs code over the full context and
returns only derived results.
- Recurse. Sub-queries and recipes split complex work across multiple
reasoning passes.
- Persist. Save sessions and resume long investigations later.
Quick Start
pip install "aleph-rlm[mcp]"
aleph-rlm install --profile claude # or: codex, portable, api
aleph-rlm doctor # verify everything is wired up
Then restart your MCP client and confirm Aleph is available:
get_status()
list_contexts()
The optional /aleph (Claude Code) or $aleph (Codex) skill shortcut starts
a structured RLM workflow. Install
docs/prompts/aleph.md into your client's
command/skill folder — see MCP_SETUP.md for exact paths.
Entry Points
| Command | Module | What it does |
|---|
aleph | aleph.mcp.local_server:main | MCP server. This is what MCP clients launch. Exposes 30+ tools for context management, search, code execution, reasoning, recursion, and action tools. |
aleph-rlm | aleph.cli:main | Installer and CLI. install, configure, doctor, uninstall for setting up MCP clients. Also: run (single query), shell (interactive REPL), serve (start MCP server manually). |
Install Profiles
aleph-rlm install asks which sub-query profile to use. Profiles configure
the nested backend that sub_query and sub_query_batch spawn for recursive
reasoning.
| Profile | What it pins |
|---|
portable | No nested backend — you choose later or rely on auto-detection |
claude | Claude CLI: --model opus, --effort low, shared session enabled |
codex | Codex MCP: gpt-5.4, low reasoning effort, shared session enabled |
api | OpenAI-compatible API — set ALEPH_SUB_QUERY_API_KEY and ALEPH_SUB_QUERY_MODEL |
aleph-rlm install claude-code --profile claude
aleph-rlm configure --profile codex # overwrite existing config
See docs/CONFIGURATION.md for all env vars, CLI
flags, and runtime configure(...) options.
First Workflow
Aleph is best when you load data once, do the heavy work inside Aleph, and only
pull back compact answers.
load_file(path="/absolute/path/to/large_file.log", context_id="doc")
search_context(pattern="ERROR|WARN", context_id="doc")
peek_context(start=1, end=60, unit="lines", context_id="doc")
exec_python(code="""
errors = [line for line in ctx.splitlines() if "error" in line.lower()]
result = {
"error_count": len(errors),
"first_error": errors[0] if errors else None,
}
""", context_id="doc")
get_variable(name="result", context_id="doc")
save_session(context_id="doc", path=".aleph/doc.json")
The important habit is to compute server-side. Do not treat get_variable("ctx")
as the default path. Search, filter, chunk, or summarize first, then retrieve a
small result.
If you want terminal-only mode instead of MCP, use:
aleph run "Summarize this log" --provider cli --model codex --context-file app.log
Local Models (llama.cpp)
Aleph can use a local model instead of a cloud API. This runs the full RLM
loop — search, code execution, convergence — entirely on your machine with
zero API cost.
Prerequisites: llama.cpp and a
GGUF model file.
# Install llama.cpp
brew install llama.cpp # Mac
winget install ggml.LlamaCpp # Windows
# Start the server with your model
llama-server -m /path/to/model.gguf -c 16384 -ngl 99 --port 8080
Point Aleph at the running server:
export ALEPH_PROVIDER=llamacpp
export ALEPH_LLAMACPP_URL=http://127.0.0.1:8080
export ALEPH_MODEL=local
aleph
Or let Aleph start the server automatically: