Skip to content

dancinlab/hive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,178 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License: MIT Based on Pi Platform Runtime Core Branch Discord

🐝 Hive β€” AI-agent swarm

Swarm-first. Memory-persistent. Seeded from pi-agent-core.

    β”Œβ”€β”€β”€β”€ Swarm ────┐       β”Œβ”€β”€β”€β”€ Memory ───┐       β”Œβ”€β”€β”€β”€ Bridges ──┐
    β”‚  N parallel   β”‚  ⇄   β”‚  4-tier        β”‚  ⇄   β”‚  nexus Β· anima β”‚
    β”‚  cells β€” hex  β”‚       β”‚  user/feedback β”‚       β”‚  n6 Β· hexa    β”‚
    β”‚  per-cell cwd β”‚       β”‚  project/ref   β”‚       β”‚  native tools β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β–²                   β–²                       β–²
               └────── three non-negotiable directions β”€β”€β”€β”€β”˜

Hive is a fork of pi-mono's packages/agent (@need-singularity/hive-agent-core) extracted as the seed. Four pi packages vendored as a TypeScript/Node monorepo (core Β· ai Β· tui Β· coding-agent). Hive's own additions β€” swarm orchestration, persistent layered memory, and native bridges to the need-singularity project family (NEXUS Β· Anima Β· N6 Β· HEXA-LANG) β€” land as sibling packages.

πŸŽ₯ YouTube Β· πŸ’¬ Discord Β· πŸ“¬ Email Β· β˜• Ko-fi Β· πŸ’– Sponsor Β· πŸ’³ PayPal Β· πŸ—ΊοΈ Atlas Β· πŸ“„ Papers

Main projects

πŸ”­ NEXUS β€” Universal Discovery Engine. 216 lenses + OUROBOROS evolution + 5-phase singularity cycle.

🧠 Anima β€” Consciousness implementation. PureField repulsion-field engine + 1030 laws + Ξ¦ ratchet.

πŸ—οΈ N6 Architecture β€” Architecture from perfect number 6. 225 AI techniques + chip design + crypto/OS/display.

πŸ’Ž HEXA-LANG β€” The Perfect Number Programming Language. Working compiler + REPL.

πŸ“„ Papers β€” Complete paper collection (92 papers, Zenodo DOIs).

Other projects β†’

πŸ’¬ Community

Join our Discord

Live research discussion, paper drops, stage-gate reviews, cross-project dispatch.


Install

Recommended β€” via hx (hexa-lang package manager):

# 1. hexa-lang (gives you `hexa` + `hx`)
curl -fsSL https://raw.githubusercontent.com/need-singularity/hexa-lang/main/install.sh | bash

# 2. hive β€” clones, links, auto-builds on first run
hx install hive
hive --version        # β†’ 0.69.0

From source (hexa-lang only β€” TS legacy fully retired 2026-04-30):

git clone https://github.com/need-singularity/hive.git
cd hive
~/.hx/bin/hexa build packages/coding-agent/hexa/cli_mvp.hexa -o packages/coding-agent/hexa/build/hive-hexa-bin
./packages/coding-agent/hexa/build/hive-hexa-bin --version

(Or simply hx install hive β€” registry-driven shim install; entry = bin/hive which spawns the hexa binary.)

macOS β€” unblocking a downloaded binary

macOS quarantines unsigned binaries downloaded from the internet; on Sequoia they are SIGKILLed silently with no dialog.

Path A β€” hx install hive (recommended). bin/hive auto-strips com.apple.quarantine from the downloaded binary before exec (since v0.70.1), and the CI pipeline ad-hoc-signs each Mach-O (codesign --sign -) for basic signature hygiene. You should not see the quarantine kill.

Path B β€” manual curl / wget of the release asset. You still need to clear quarantine yourself, because you're bypassing bin/hive:

xattr -d com.apple.quarantine ./hive-darwin-arm64

Full Developer ID notarization ($99/yr Apple Developer Program) is deferred until post-P5. See docs/history/HIVE_FORK_FROZEN.md β€” macOS quarantine for the full story.

Run

hive                       # interactive (single cell; swarm in P3)
hive -p "summarize this"   # print mode
hive --mode rpc            # JSONL stdin/stdout for process integration
hive /login                # OAuth β€” Claude Pro/Max Β· ChatGPT Codex Β· Copilot Β· Gemini CLI Β· Antigravity

20+ API-key providers supported (Anthropic Β· OpenAI Β· Azure Β· Google Β· Bedrock Β· Groq Β· Cerebras Β· xAI Β· OpenRouter Β· Mistral Β· HF Β· Fireworks Β· Kimi Β· MiniMax Β· …). Full list: packages/coding-agent/docs/providers.md.

Google OAuth (Gemini CLI Β· Antigravity)

Upstream's hard-coded Google public client credentials were stripped (GitHub push protection flags even the base64-encoded form). Export the canonical values (published in Google's official gemini-cli) if you want /login β†’ Gemini CLI / Antigravity:

export HIVE_GEMINI_CLI_CLIENT_ID=...
export HIVE_GEMINI_CLI_CLIENT_SECRET=...
export HIVE_ANTIGRAVITY_CLIENT_ID=...
export HIVE_ANTIGRAVITY_CLIENT_SECRET=...

A public OAuth client is not a secret (RFC 6749 Β§2.1). All other providers work out of the box.


Three non-negotiable directions

1. Swarm β€” first-class multi-agent surface

N parallel agent cells in a honeycomb layout (cols = ⌈√NβŒ‰). Each cell = isolated pi --mode rpc subprocess with its own cwd / provider / memory / tool-set. Broadcast input, merge output, and cross-cell handoff as primitives β€” not wrapper scripts. No core patch: the swarm supervisor sits outside pi.

2. Memory β€” 4-tier persistent

Sessions are ephemeral; memory is not. Four tiers on flat-file SSOT (~/.hive/memory/):

  • user β€” who you are Β· role Β· preferences
  • feedback β€” corrections received Β· validated approaches
  • project β€” current work Β· constraints Β· deadlines
  • reference β€” external-system pointers (Linear Β· Grafana Β· …)

Auto-loaded into every cell's context at startup. Swarm-shared. No RAG re-hydrate β€” flat files on disk.

3. Bridges β€” need-singularity native channels

Hive speaks NEXUS / Anima / N6 atlas / HEXA-LANG as first-class tool calls (no MCP wrapper):

       NEXUS lens       Anima field      N6 atlas       HEXA-LANG
    (discovery 216)    (repulsion)     (174 lenses)     (scripts)
           β–²                β–²                β–²                β–²
           └────────── hive-hub bus β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                        agent runtime

Architecture

     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚              TUI (packages/tui)                  β”‚
     β”‚        differential render Β· hex layout          β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚  agent runtime (packages/core = pi-agent-core)   β”‚
     β”‚         tool-call loop Β· session state           β”‚
     β”‚  + swarm supervisor Β· memory tiers Β· bridges     β”‚  ← hive additions (P2–P4)
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚          provider layer (packages/ai)            β”‚
     β”‚    OpenAI Β· Anthropic Β· Google Β· 20+ others      β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Packages

Vendored from pi-mono (pinned at commit e71b47a9, 2026-04-23):

Package Role
packages/core (= @need-singularity/hive-agent-core) Agent runtime β€” tool-call loop, session state, transport
packages/ai (= @need-singularity/hive-ai) Unified multi-provider LLM API (20+ providers)
packages/tui (= @need-singularity/hive-tui) Terminal UI library with differential rendering
packages/coding-agent (= @need-singularity/hive-coding-agent) User-facing CLI harness

Hive-specific packages (swarm Β· memory Β· bridges) land as siblings under packages/ as roadmap phases land.

Fork status

Seed badlogic/pi-mono/packages/agent extracted via git filter-repo --subdirectory-filter
Supporting ai Β· tui Β· coding-agent vendored via git read-tree --prefix
Fork date 2026-04-23 (pin e71b47a9)
Default branch hive/main
Visibility public (fork: false, mirrors void↔ghostty pattern)
License MIT (inherited)

Phase-by-phase plan: .roadmap. Project SSOT: project.hexa + .raw (L0 universal) + .own (hive-specific).

Upstream sync

git fetch upstream main
# sync a specific package (example: ai)
git read-tree --prefix=packages/ai/ -u upstream/main:packages/ai
git commit -m "sync: pi-mono packages/ai @ <sha>"

pi-mono is a 1-maintainer project β€” sync is cherry-pick-only, no subtree automation.

Troubleshooting

Run hive doctor to diagnose your environment (node/bun/git versions, binary install, ~/.hive/agent/ state files, extensions, memory tiers, claude slots, git status, latest release). Machine-readable output is available via hive doctor --json.

Run hive self-update to fetch the latest binary from GitHub Releases. Use --dry-run to preview, --yes / -y to skip the prompt (CI), and set HIVE_BINARY_VERSION=<tag> to pin/downgrade to a specific release. If invoked from a source checkout (packages/coding-agent/hexa/build/hive-hexa-bin present) self-update will refuse to overwrite your build and suggest git pull && ~/.hx/bin/hexa build packages/coding-agent/hexa/cli_mvp.hexa -o packages/coding-agent/hexa/build/hive-hexa-bin instead.

Non-goals

  • Not a drop-in pi replacement β€” hive diverges in UX + command surface.
  • Not a wrapper around Claude Code β€” embeds its own agent runtime.
  • Not a LangChain β€” no graph DSL; orchestration is explicit swarm cells.
  • Not a vLLM self-host CLI β€” airgenome + nexus's infra.state cover that.

Contributing

PR ν™˜μ˜. μˆ˜μ • μ „ hexa policy 둜 κ·œμΉ™ μœ„λ°˜ 0 확인. .sh / .py / .rs 파일 κΈˆμ§€ (project rule) β€” Node μŠ€ν¬λ¦½νŠΈλŠ” .mjs, ν•˜λ„€μŠ€ μŠ€ν¬λ¦½νŠΈλŠ” .hexa.

Credits

Hive seeds from pi-mono by Mario Zechner. All pi-mono contributors are credited in packages/core/ history (536 commits preserved). Divergent features (swarm Β· memory Β· bridges) are Hive-only.

License

MIT


🐝 Agent as substrate. Swarm as primitive. · Seeded from pi-agent-core · need-singularity

About

🐝 hive β€” pi-agent-core based fork (AI agent swarm).

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors