Skip to content

SoW: Autonomous GitHub agents (issue-crusher / PR reviewer / docs) on a shared codegraph engine #12

Description

@sanil-23

Summary

Build autonomous GitHub agents inside OpenHuman — a GitHub issue-crusher, a PR reviewer, and a docs (.md) writer — as user-enableable skills sitting on top of a shared codegraph retrieval engine plus a shared orchestration layer. Separately, build a merged-PR "source tree" memory using the existing memory_tree pipeline.

This SoW captures a design that was validated empirically (see Evidence), not just proposed.


Architecture

SKILLS (agent.toml defs · enable in Intelligence/Skills UI)
  • github-issue-crusher   • pr-reviewer   • docs-writer (.md)
  each = prompt + tool allowlist + autonomy tier + iteration cap + trigger
        |
SHARED TOOLS the skills call
  • codegraph_search   • Composio GitHub   • #2631 grep/glob/lsp/read/edit/shell
        |
codegraph MODULE  (src/openhuman/codegraph/)        ← the retrieval engine
  index:    checkout → BM25 + structural-aug vectors + repo-map (incremental)
  retrieve: seed(query) = BM25 ∪ dense → RRF → candidate block + repo-map
  reuses the embeddings provider (local Ollama); NOT memory_tree
        |
ORCHESTRATION (shared services)
  trigger (cron poll / GitHub webhook) → clone/checkout (~/OpenHuman/projects,
  #2631 trusted root) → branch + push + open PR → issue-claim state

Skills (each an agent.toml in the agent-definition registry)

Skill Trigger Uses Output
github-issue-crusher issue opened/labeled codegraph_search (seed) → grep/lsp/edit/run_tests → Composio branch + PR (Closes #N)
pr-reviewer PR opened/synced codegraph_search (touched code in context) → read/grep → Composio inline review comments
docs-writer (.md) manual / on-merge codegraph_search (read code) → edit README / docs / AGENTS.md PR

docs-writer doubles as the maintainer of a per-repo AGENTS.md "learnings" file the crusher reads for context.


codegraph engine

Two-stage retrieval: zero-build seedcapped agentic.

Exposed as a codegraph_search tool + RPC. Reuses only the embeddings provider config (Ollama) — not memory_tree.


Evidence (A/B harness — feat/codebase-memory-ab, bench/codebase-memory-ab/)

SWE-bench_Lite retrieval eval, file-level recall vs the files each gold patch edits, n=18 across requests/flask/pytest/pylint/sphinx/xarray, bge-small held constant:

recall@10:  Dense(raw) 0.556  <  BM25 0.667  <  Dense(structural-aug) 0.778
  • Raw-code embeddings lose to BM25 (confirmed across small and 1000–1900-file repos).
  • Structural-augmentation dense (free, ast-based) beats BM25 at recall@5/10/20.
  • BM25 and structural-aug are complementary → union of their top-10 = recall@10 ≈ 1.0 on every winnable instance.

→ The seed = BM25 ∪ structural-aug + repo-map is the empirically-backed design.


Decisions locked

  • ✅ Seed (BM25 ∪ structural-aug + repo-map) → capped agentic.
  • ❌ No raw-code vector index (loses to lexical).
  • ❌ No memory_tree for code reading — its recall is over a lossy summary tree; admission drops chunks, source-id idempotency blocks re-index, and it pollutes personal memory.
  • ❌ No LLM-gloss embeddings / hosted vector DB for v1 (build-token cost, unneeded).
  • Reuse only the embeddings provider (local Ollama).

Merged-PR memory tree (separate workstream — where memory_tree does fit)

Build a source tree of merged PRs via the existing memory_tree pipeline (scope = "pr:<owner>/<repo>", ingest each merged PR as a document). PR history is prose + episodic + summarizable + recency-relevant — exactly memory_tree's home turf (unlike code). Enables semantic recall like "have we fixed something like this before?" to inform the issue-crusher.


Orchestration & open gaps


Build order

  1. codegraph module — index + codegraph_search tool (shared dependency, build first).
  2. github-issue-crusher agent.toml — first consumer, proves the engine end-to-end.
  3. Orchestration glue — trigger → checkout → PR + creds.
  4. pr-reviewer + docs-writer skills — reuse the same engine + glue.
  5. Merged-PR memory tree — parallel workstream on memory_tree.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions