Skip to content

Repository files navigation

🐝 Hive — an organisation of AI coworkers

Hive is a chat-first workspace for a small org of AI coworkers. Talk to the room: it reads whether you want to work or just talk. Give it a task and a team assembles, works in parallel, debates, hands off between each other, and ships real files and docs onto a board.

▶ Live: hive-psi-one.vercel.app

Hive running a task, with deliverables coming off the line


What it does

  • The room reads the room. Every message goes through an intent classifier: real work starts a working session, small talk starts a casual conversation where each coworker decides in character whether to chime in.
  • Auto mode assembles a team. Describe the task and the lead spins up a roster with the right roles, then runs the floor: coworkers are activated in parallel, talk to each other by name, agree/challenge/build on each other, and ship concrete files or docs each round.
  • Built-in orgs, or your own. Four presets (🧭 Product Delivery · ⚡ Hackathon Sprint · 🎬 Content Studio · 🚨 Incident War Room) — each is a full org config: roster + workflow + accent theme. The editor is full CRUD and custom orgs persist to your account.
  • Real deliverables. Finished work lands as documents in a dedicated rail — preview the built site live in a sandboxed frame, copy as Markdown, export PDF, or download the whole project as a .zip.
  • Live web + vision. With web access on, coworkers ground their work in current data via Tavily (falling back to Google Search grounding) and cite sources. Attach an image and a vision model scans it into shared context first.
  • Resume past runs. Every session is saved; open it later and keep building from where it stopped.

Engines — a resilient brain pool

Hive runs each coworker on its own "brain" — a model/key slot in a server-side pool:

  1. Providers: Gemini (gemini-flash-latest) and Groq (llama-3.3-70b) keys are pooled server-side (GEMINI_API_KEY, GEMINI_API_KEY_2…, GROQ_API_KEY, …). The browser only knows the shape of the pool (VITE_BRAINS=gemini:3,groq:2) — never the keys.
  2. Failover: every call tries its preferred brain, then walks the whole pool, so one rate-limited key can't stall a run.
  3. Web search: Tavily via /api/search; if it returns nothing, grounded Gemini is tried, then plain live.
  4. Graceful step-down: live → grounded → plain → deterministic offline simulator. No key, no network, no problem.

Accounts & sync

Optional email/password accounts (enable with VITE_AUTH=1): JWT sessions in an HttpOnly cookie, bcrypt hashes, Neon Postgres. Your orgs, history, and settings sync to your account (one JSON blob, debounced push/pull). Without accounts everything works locally in the browser.

Run it locally

npm install
npm run dev

That's it — with no server configured, Hive runs on the offline engine. To go fully live you need the serverless functions, so prefer:

npm i -g vercel
vercel dev

Configure .env.local from .env.example (Gemini/Groq/Tavily keys, VITE_BRAINS, and optionally DATABASE_URL + AUTH_SECRET + VITE_AUTH=1 for accounts).

Deploy

Deployed on Vercel: static Vite client + serverless functions in api/. Set the env vars from the table in .env.example (keys, VITE_BRAINS, TAVILY_API_KEY, and for accounts DATABASE_URL, AUTH_SECRET, VITE_AUTH=1, VITE_PROXY=1), then vercel --prod.

Stack

Vite · React 19 · TypeScript · Tailwind CSS · Zustand · Framer Motion · anime.js · lucide-react. Fonts: Inter / JetBrains Mono. Design language: a refined dark studio — neutral near-black slate, one accent per org, quiet glass panels — with shipped work landing as light paper documents.

Project shape

api/
  _lib/            Neon Postgres client + JWT session helpers
  auth/            signup · login · logout · me
  data.ts          per-user cloud sync (one JSONB blob)
  gemini.ts        Gemini proxy (+ Google Search grounding)
  llm.ts           the brain pool — routes prompts across Gemini/Groq keys
  search.ts        Tavily web search
  vision.ts        image analysis
src/
  components/      TopBar · ModeMenu · RoomHeader · Feed · Composer ·
                   OffTheHive (deliverables rail) · Landing · AuthScreen ·
                   SettingsPage · HistoryModal · ModeEditor · PreviewModal · ui primitives
  engine/          brains (key pool) · llmClient · floor (prompts/parsers) ·
                   chat (intent + casual talk) · autoTeam · gemini/proxy/sim engines ·
                   webSearch · vision
  lib/             auth (zustand + sync) · storage · export (md/pdf/zip/preview) · iconFor
  data/modes.ts    built-in org presets
  store.ts         zustand store — intent routing, the floor loop, history, cloud snapshot

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages