onesearch

Orientation for agents and humans

Start every session oriented.

onesearch

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

Ask a question. Get a place to start.

Asked in a real checkout of Pydantic. OneSearch returns the declaration and its docstring. The output below is captured verbatim.

onesearch · ~/repos/PYDANTIC looping live query
$ 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
0.5 msWarm query, median on OneSearch's own 1,357-chunk checkout.
50–99%Fewer billed input tokens in three paired agent runs for the same or a better answer.
orientMaps purpose, applications, layers and core flows from tracked source, with a citation for every claim.

02 / WHY

Every session starts from zero.

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

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.

02

Spans, not file dumps

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

Past sessions count too

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

One snapshot, one process, two retrievers.

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.

01 · INDEX

Tracked files

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.

02 · EMBED

One pass per file

potion-code-16M-v2, 256 dimensions, stored in a flat .osb snapshot.

03 · QUERY

Two candidate lists

Exact cosine over vectors and BM25 over interned terms, asked in parallel.

04 · FUSE

Reciprocal rank

RRF with an alpha that shifts between identifier and natural-language queries, plus measured boosts. --rank picks lexical, semantic or hybrid.

05 · OUTPUT

Ranked ranges

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

Deterministic, not improvised

Declarations and calls are read from the parse tree, not guessed by a model. The same checkout yields the same bytes.

02

Any linked language

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

Less reorientation, less invention

Start with the flow through the code; use search for details, including past sessions when the question needs them.