ozagia indexes a repository into files, symbols, tests, docs, infrastructure and their links, keeps that graph current while the agent edits, and answers the agent's own reads, searches, edits and test runs through it. It also includes a source-backed research agent for papers and evidence. It ships as OpenCode's terminal UI with the graph built in.
$ curl -fsSL https://ozagia.com/install | bash
then cd your-repo && ozagia · Linux and macOS · no Python needed
The agent keeps calling the tools it already knows. Each answer comes back in the same
shape, with graph context on lines that start with [ozagia]: which symbol a line belongs
to, which tests cover it, what an edit changed, and which test a failure points at. Before each
model call, a short hint built from the request names the code and infrastructure it is probably
about.
# the agent reads a file Read file /repo/pkg/mod.py, lines 1-20 [ozagia] file:pkg/mod.py imports: 0 imported by: 2 tests: 2 1: """Module.""" 2: import os [ozagia] sym:pkg/mod.py::helper tests: 2 (test:tests/test_mod.py::test_helper, ...) 5: def helper(a, b=1): # the agent runs: cd /repo && python -m pytest tests/test_mod.py -q 2>&1 | tail -3 1 failed, 1 passed in 0.41s [ozagia] pytest failed: exit 1, 0.4 s, 1 passed, 1 failed, 0 error, 0 skipped [ozagia] failed test:tests/test_mod.py::test_broken: assert 3 == 5 [ozagia] frame test:tests/test_mod.py::test_broken tests/test_mod.py:9 # the agent edits Edited /repo/pkg/mod.py (1 replacement) [ozagia] in: sym:pkg/mod.py::helper [ozagia] delta: 0 added, 0 removed, 1 changed, edges +0 -0: ~sym:pkg/mod.py::helper
ozagia keeps OpenCode as the agent and the interface. A plugin hands OpenCode's built-in tools to a graph daemon, which carries out what each call is for.
Files, symbols, tests, docs, imports, git history and known failures go into one graph snapshot. Tree-sitter covers Python, Rust, TypeScript, Go, Java, C/C++ and Lua. Project adapters add their own nodes.
The OpenCode plugin replaces read, grep, glob,
edit, write and shell. Each call goes to the daemon first.
The daemon runs the call against the graph. It reads by line or node key, groups grep matches by symbol, edits by exact span, and maps pytest results to test keys. Compound shell commands run step by step with bash's exit statuses.
Every change is reingested at once, per file, and gives back a graph delta. Anything the graph can't carry out, such as inline Python or heredocs, goes to OpenCode's built-in tool. The graph then adds context afterwards.
Before the daemon writes or runs anything, the plugin asks OpenCode's permission service with
the request the built-in tool would make, including the diff for an edit. Your allow,
ask and deny rules apply to captured calls too.
Commands that move git refs (commit, push, reset,
checkout, ...) are refused wherever they appear. That includes inside
env, xargs, sudo, timeout,
find -exec, bash -c, substitutions and git aliases.
The graph, the daemon and the index live on your machine, in the repository's
.ozagia/ directory. ozagia adds no service and no account. It uses whatever model
you configure in OpenCode, including a local one.
The same graph holds research: sources, references, claims, evidence, assumptions, notation and theories. Each item links back to the passage it came from. An agent can read a paper, review it with several models, and build a synthesis. Every step stays inspectable. ozagia records candidates and reviewer judgements, never verdicts.
TeX and Markdown papers, PDFs (with GROBID, PyMuPDF or pdftotext, and OCR as a
fallback), TEI/JATS, EPUB books, HTML snapshots and notes. References come from BibTeX, BBL,
CSL-JSON, RIS or Zotero. Spans are hashed, so every claim keeps its locator.
References resolve through arXiv, Crossref, OpenAlex, Unpaywall and Europe PMC. Open-access copies are fetched into a content-addressed cache with their hashes checked. Citation neighbourhoods and paths come from OpenAlex. Paywalls are never bypassed.
A review plan assigns roles (methods, statistics, domain, reproducibility, ethics) to independent model runs. ozagia then measures their agreement (Fleiss' κ), reconciles the findings and keeps the dissent. Each main claim gets steelman, red-team and synthesis arguments.
Screening decisions, study extraction tables with effect sizes, risk-of-bias and GRADE-style certainty records, contradiction candidates, retraction alerts, and theory comparison that reports whether any evidence actually discriminates between rivals.
Manuscript checks flag unresolved or retracted citations and claims without a source. A bundle
holds manuscript.md, references.bib, a claims table and the checks,
with optional Pandoc conversion. Formulas can be interpreted against the paper's notation and
exported to Lean.
ozagia --research opens the TUI with the research tools alongside the code
graph. ozagia mcp --mode research serves them to any MCP client, and
ozagia-research is the CLI. The research state stays in the workspace's
.ozagia/ directory.
For SRE and platform work, an opt-in adapter adds infrastructure as code to the graph: resources, modules, providers, workloads, services and the links between them. The agent can then ask what a change touches before making it. The adapter only reads source files. It never contacts a cloud account or a cluster, and never reads state or variable files.
Terraform and OpenTofu (HCL and JSON), Kubernetes manifests, Helm and Kustomize, CloudFormation, ARM JSON, Pulumi YAML, supplied CDK assemblies, and GitOps definitions. Local modules, provider aliases and Terraform addresses resolve where they are written statically.
infra_context, infra_locate, infra_dependencies and
infra_impact find a resource, follow its references and selectors, and show what
a change would reach. infra_status reports what was and wasn't extracted.
infra_import_sarif reads a SARIF 2.1 report you supply and returns its findings'
metadata. It runs no scanner and stores nothing. When a request names infrastructure, a short
hint with source paths reaches the model before its call. Code and infrastructure share one
budget.
# .ozagia.toml in the repository [adapters] modules = ["ozagia.integrations.iac.adapter:register"] # then ozagia index && ozagia
This is partial static analysis. It is not deployment state, plan output or a
security scan. Dynamic expressions, remote modules and cross-namespace links stay unresolved, and
they show as unresolved rather than absent. On a synthetic 1,500-file corpus, a cold build took
3.4 s and a warm infra_locate 0.11 ms (benchmark).
These come from live pilots on a large research repository (8,134 files, 57,230 symbols, 14,119 tests). A local 27B model ran through OpenCode on break/fix tasks: one behaviour is broken, and the existing tests decide whether it is fixed.
| Pilot | Arm | Solved | Median wall time | Calls handled by the graph |
|---|---|---|---|---|
| 7 tasks × 3 | plain OpenCode | 21/21 | 47.9 s | — |
| 7 tasks × 3 | OpenCode + ozagia | 21/21 | 28.9 s | — |
| 8 harder tasks × 3 | plain OpenCode | 23/24 | 109.7 s | — |
| 8 harder tasks × 2 | OpenCode + ozagia (v4) | 16/16 | 97.1 s | 73% |
These are small samples of 2 or 3 repeats per task, and single slow runs move them a lot. Token use was not lower in the latest run. The raw results and the caveats are in docs/results.
ozagia in a repository opens OpenCode's terminal UI. The daemon and plugin are set
up for the session and removed afterwards. ozagia agent --prompt "…" runs one task
without the UI.
ozagia mcp gives any MCP client the graph tools: repo map, code search, callers and
impact, node reads, graph-addressed edits and checks. --mode research or
combined adds the research ledger, and the infrastructure adapter adds the
infra_* tools.
from ozagia.core.memory import DevMemory gives the graph, the incremental reingest,
the edit transaction and the intent layer, to build your own harness.
Claude Code hooks add graph context after each tool and refuse ref-moving git; they are untested against a live Claude Code. A small native agent loop runs on any OpenAI-compatible API.
One command. It installs a self-contained ozagia, with its own Python, parsers and research
libraries, and a
pinned OpenCode release under ~/.ozagia. Every download is checked against a pinned
sha256. The command also adds ~/.ozagia/bin to your PATH. Your own OpenCode install is
left alone.
# install (Linux x64/arm64, macOS arm64/x64) curl -fsSL https://ozagia.com/install | bash # a specific version, or without editing shell startup files curl -fsSL https://ozagia.com/install | bash -s -- --version 0.1.1 --no-modify-path # use cd your-repo ozagia # the TUI with the graph ozagia --research # the TUI with the research tools too ozagia index # build or refresh the graph only # manage ozagia self check --tui # verify: runtime, parsers, OpenCode, plugin loads in the TUI ozagia self upgrade ozagia self uninstall --yes
Models and providers are configured as for OpenCode
(~/.config/opencode/opencode.json). From source:
uv pip install -e '.[all]' in a clone of
ozmalabs/ozagia. Details are in
docs/install.md.