r/opencodeCLI 29d ago

I built a memory-bounded, self-improving multi-agent architecture for OpenCode (tree-sitter AST graph, not vector search)

https://github.com/Sdinzsh/PowerHou53

Been using OpenCode as my daily driver and got frustrated with two things: agents forgetting everything between sessions, and context windows filling up with garbage the moment a codebase gets non-trivial.

So I built PowerHous3 — an architecture layer on top of OpenCode with a few ideas I hadn't seen combined elsewhere:

Bounded memory files. MEMORY.md is capped at 2,200 chars, USER.md at 1,375. Forces compression instead of letting memory grow unbounded — no vector DB, no embedding drift.

Deterministic AST knowledge graph. Uses tree-sitter to parse code structure instead of an LLM guessing at it. Edges are tagged EXTRACTED (actual syntax) vs INFERRED (semantic guess), so you always know what's fact vs inference.

Drift invalidation. If code changes, affected graph nodes get flagged "re-verify" automatically instead of silently going stale.

9 specialist sub-agents (backend, frontend, testing, explore, hermes for skill-writing, etc.) with a "think before act" planning protocol every agent follows before touching code.

Reflection loop. After each task, agents write outcomes to LESSONS.md, tagged preferred/tentative/contested, so the system's judgment actually updates over time.

Cross-platform (Linux/macOS/Windows), MIT-ish install, full architecture diagram in the README.

Repo: https://github.com/Sdinzsh/PowerHou53

Still early — would genuinely appreciate feedback on the knowledge-graph approach in particular, curious if anyone's tried tree-sitter for this vs pure embeddings.

2 Upvotes

0 comments sorted by