01
Reach for it before grep
Hybrid lexical and vector ranking is the default, so a plain-language question and a bare symbol both get ranked candidates. Switch to --rank lexical or --rank semantic when you already know which half you need.
Orientation for agents and humans
OneSearch is a local context layer for agents and humans. One index holds the code and the coding-agent sessions that changed it — OneLoop, Codex, Claude Code and Antigravity. Ask in plain language or by symbol; get ranked spans with a location, in milliseconds. Everything runs locally in one binary — no server, no API call.
01 / LIVE RUN
Asked in a real checkout of Pydantic. OneSearch returns the declaration and its docstring. The output below is captured verbatim.
$ os search 'Where is snake_case converted to camelCase?' -k 1
1 hits for Where is snake_case converted to camelCase? (100 = best match):
1 100 pydantic/alias_generators.py:25-40 def to_camel(snake: str) -> str:
-- 1 pydantic/alias_generators.py:25-40
def to_camel(snake: str) -> str:
"""Convert a snake_case string to camelCase.
Args:
snake: The string to convert.
Returns:
The converted camelCase string.
"""
# If the string is already in camelCase and does not contain a digit followed
# by a lowercase letter, return it as it is
if re.match('^[a-z]+[A-Za-z0-9]*$', snake) and not re.search(r'\d[a-z]', snake):
return snake
camel = to_pascal(snake)
return re.sub('(^_*[A-Z])', lambda m: m.group(1).lower(), camel)
The run loops like a screencast; the text is captured verbatim from ~/repos/PYDANTIC. -k is a cap, not a promise. Hybrid is the default: reach for --rank lexical when you already know the symbol, --rank semantic when you can only describe the behavior. batch asks several questions in one pass; --help covers filters, related and JSON output.
Quick start
$ curl -fsSL https://raw.githubusercontent.com/oneness/OneSearch/main/install.sh | bash
02 / WHY
An agent starts each session blank, and so does a person opening an unfamiliar repo. The first turns go to rediscovery — grepping for a name, opening a file just to learn its shape, paying for context that turns out not to matter. OneSearch is built for that first minute: one query across the code and the decisions recorded in past sessions, with an answer you can check.
01
Hybrid lexical and vector ranking is the default, so a plain-language question and a bare symbol both get ranked candidates. Switch to --rank lexical or --rank semantic when you already know which half you need.
02
Results are ranges with a score and an explanation, folded to one hit per file. batch asks several questions in one pass, so an agent can check two angles of a question before reading a single file. --explain shows every multiplier.
03
OneLoop, Codex, Claude Code and Antigravity logs are indexed alongside code, so “what did we decide last Tuesday” has a location. Session text can be private — review before sharing it.
03 / HOW IT WORKS
Building the snapshot is the only upfront cost; after that, queries run against a warm index. There is no server to start and no API to call; the hot path never touches the environment.
One git ls-files for code, plus session stores — the default .oneloop/sessions or any you point at. Tree-sitter top-level blocks, else a byte-safe line fallback.
potion-code-16M-v2, 256 dimensions, stored in a flat .osb snapshot.
Exact cosine over vectors and BM25 over interned terms, asked in parallel.
RRF with an alpha that shifts between identifier and natural-language queries, plus measured boosts. --rank picks lexical, semantic or hybrid.
Sorted, tie-broken on path and line, one hit per file, with explanations on request.
A single-page map of the code path lives in docs/mental-model.md. Retrieval quality is gated by the golden records and suites under tests/. batch answers several questions in one pass — useful when an agent needs the definition and the behavior before it reads anything.
04 / ORIENT
orient: a map of what the project does.The orient command reads tracked source and project
documents to print a cited map of what a repository is for: its
purpose, entry points, applications, core flows and the code that
carries them.
Everything is bounded and deterministic — workspace manifests,
runtime surfaces, call-graph communities and concept-to-code links
are grounded in files and lines, with no model or API call. It is
for the first few minutes with an unfamiliar checkout, when an
agent or a human needs a place to start before reading code.
01
Declarations and calls are read from the parse tree, not guessed by a model. The same checkout yields the same bytes.
02
No config file: sources come from src/, Cargo workspace members, or the checkout root. A Rust workspace and a TypeScript project both get a flow.
03
Start with the flow through the code; use search for details, including past sessions when the question needs them.