fungus
Fungus is an AI agent that evolves through experience, mimicking the growth of real fungi.
๐ Fungus
An AI agent that grows from experience โ like fungi.
Hyphae sense the soil. Mycelium digests the nutrients. Fruiting bodies emerge.
What is Fungus? ยท Quickstart ยท How It Works ยท Structure
</div>๐ฑ What is Fungus?
Fungus is an AI agent built on Kiro CLI.
Like a real fungus, it starts invisible. Hyphae โ the finest tips of the network โ extend into every interaction, sensing corrections, failed commands, and patterns you might not notice yourself. These raw signals are spores, scattered and unprocessed.
Beneath the surface, the mycelial network quietly digests these spores into nutrients โ structured knowledge that strengthens the network with every session. The more it absorbs, the sharper its hyphae become.
When enough nutrients accumulate around a recurring pattern, a fruiting body emerges โ a new skill, ready to use. The mushroom you see above ground is just the visible tip; the real intelligence lives in the network below.
And like any fruiting body, it releases spores back into the soil โ every skill in use generates new interactions, new signals, new raw material for the hyphae to sense. The cycle continues.
spores nutrients fruiting
Soil โโโโ Hypha โโโโ Mycelium โโโโ Fruit
โ โ
โโโโโโโโโโโโโ spores โโโโโโโโโโโโโโโโ
โก Quickstart
git clone https://github.com/nsqk11/fungus.git
cd fungus
bash install.sh
Prerequisites: Kiro CLI ยท Python 3.12+ ยท Bash โฅ 4.0
๐ฌ How It Works
Fungus hooks into the Kiro CLI lifecycle. Each hook is a patch of soil โ hyphae extend into it, sense what's there, and feed the network.
| Module | Role | When |
|---|---|---|
| Hypha | Sense signals, filter noise | Every interaction |
| Mycelium | Digest spores into structured nutrients | Session start |
| Fruit | Detect mature patterns, produce new skills | Session start |
Hyphae sense silently in the background. Mycelium and Fruit prompt the agent at session start โ the user decides when to digest or review.
Sensing and Filtering
Hyphae don't capture blindly โ structural filters discard noise at the source:
| Hook | What Passes | What Gets Dropped |
|---|---|---|
userPromptSubmit | Prompts > 5 chars | Trivial acks ("ok", "ๅฏ") |
preToolUse | Non-self-referential, non-read/write calls | memory.py calls; fs_read, fs_write, grep, glob, code, todo_list |
postToolUse | Tool failures only | Successful tool results |
stop | All assistant responses | Nothing |
At the end of each turn, Hypha aggregates the tool sequence into a single
toolChain spore and removes the individual preToolUse spores.
This gives Mycelium a clean signal: what the user asked, what tools were used,
whether anything failed, and what the agent concluded.
Data Flow
Nutrients flow in one direction โ from raw spores to mature memory:
spore โ nutrient โ network (permanent memory)
spore โ nutrient โ fruiting (skill candidate)
spore โ skipped (no value)
โ โ โ โ
Hypha Mycelium Fruit substrate
writes writes writes cleans
Each module writes to its own partition in memory.db.
Memory is shared โ a single data/memory.db serves all agents.
Substrate runs clean on agentSpawn before any module โ
removing skipped and consumed fruiting entries.
Boundaries are declared in each script's annotations โ
no central config:
# @hook postToolUse
# @priority 10
# @module hypha
# @reads spore
# @writes spore
# @description Sense tool errors from environment
The substrate scans these annotations at runtime to route hooks to the correct scripts.
๐ Grown Skills
Skills are the mushrooms โ visible outputs of the underground network.
| Skill | Description |
|---|---|
| atlassian-api | Unified REST API client for Confluence and Jira |
| office-toolkit | Scrape and patch Office documents (docx, pptx, xlsx) via XML |
๐ Structure
fungus/
โโโ assets/ Images
โโโ data/
โ โโโ memory.db Shared memory (gitignored)
โโโ hooks/
โ โโโ substrate.sh Signal conductor โ reads hook from stdin, routes to modules
โ โโโ substrate.py Scan annotations, match hook, sort by priority
โ โโโ memory.py CRUD operations for memory.db
โ โโโ README.md Hook payload reference
โโโ modules/
โ โโโ hypha/ Sense โ explore and detect signals
โ โ โโโ SKILL.md
โ โ โโโ scripts/
โ โโโ mycelium/ Digest โ break down and store knowledge
โ โ โโโ SKILL.md
โ โ โโโ scripts/
โ โโโ fruit/ Grow โ detect patterns, produce skills
โ โโโ SKILL.md
โ โโโ scripts/
โโโ skills/ Mushrooms โ grown by the network
โ โโโ atlassian-api/
โ โโโ office-toolkit/
โโโ prompts/ Shared prompt frameworks
โโโ install.sh
โโโ LICENSE