This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
Hive is a private, multi-user AI life assistant that runs entirely on a Raspberry Pi 4B β no cloud, no subscriptions, no data leaving your home network.
I built it for my family. We needed a shared space to manage our week: upcoming events, daily expenses, and a clear picture of what actually matters each day. Every existing tool either costs money every month, sends your data somewhere, or needs a good internet connection. Hive does none of those things β it lives on a Pi on the shelf and is accessible from any phone on the home Wi-Fi.
What it does:
- π¬ AI Chat β talk naturally: "I spent βΉ150 on paav bhaji" or "Schedule a gym session tomorrow at 7am" β Hive routes your message to the right agent and writes to the database
- π Event Planner β add, view, and delete calendar events; the AI checks for conflicts automatically
- πΈ Expense Tracker β log spending by category with a monthly budget summary and INR formatting; export to JSON or CSV
- π― Priority Ranking β AI scores your upcoming events and expenses by urgency so you always know what to focus on
- ποΈ Voice Input β speak instead of type, transcribed locally by OpenAI Whisper (no audio leaves the Pi)
- π Morning Briefings β the Pi pushes a daily summary to all connected users via WebSocket at a scheduled time
- π± Multi-user, multi-device β family members register by name + PIN, each has their own data, accessible from any phone on the same Wi-Fi
Demo
The app runs on a Raspberry Pi 4B (8 GB) on the local network. Any device on the same Wi-Fi opens
http://<pi-ip>:8000to get the full PWA.
π₯ Watch the demo:
https://youtu.be/ykFI4QWlZVs
Code
π GitHub Repository:
https://github.com/kondekarshubham123/Hive
Key file structure:
hive/
βββ server/
β βββ main.py # FastAPI app, WebSocket, SPA routing
β βββ agents/
β β βββ orchestrator.py # LangGraph StateGraph β keyword classify β route β tool-call loop
β β βββ tools.py # LangChain tools: create_event, log_expense, get_open_tasks, ...
β β βββ state.py # HiveState TypedDict
β βββ routers/
β β βββ auth_router.py # Register / login by name+PIN, JWT issue
β β βββ chat.py # POST /chat β SSE streaming, history fetch, message persist
β β βββ events.py # CRUD /events
β β βββ expenses.py # CRUD /expenses + budget summary
β β βββ priorities.py # GET + POST /refresh β LLM priority scoring
β β βββ voice.py # POST /voice β Whisper transcription
β βββ database.py # aiosqlite, 6-table schema, single DB_PATH
βββ client/ # React 19 + Vite + Tailwind CSS PWA
βββ setup/
βββ install_pi.sh # One-shot Pi setup: apt, Ollama, venv, Node, systemd
βββ Modelfile # hive-fast: gemma2:2b + tuned context/temperature/stop
How I Built It
Open-source AI stack
| Layer | Technology |
|---|---|
| LLM runtime |
Ollama β runs hive-fast, a custom build of Gemma 2 2B (Google's open-weight model) |
| Agent framework |
LangGraph 0.2 β StateGraph with conditional routing |
| LLM library | LangChain / langchain-ollama |
| Voice transcription |
OpenAI Whisper base.en β runs locally, no API key |
| Backend | FastAPI with SSE streaming and WebSocket |
| Database | SQLite via aiosqlite |
| Frontend | React 19, Vite, Tailwind CSS |
Agent architecture
The core insight is a keyword intent classifier in front of the LangGraph router. Instead of running a second LLM inference to classify intent (which added 4β7 s per request), a simple keyword scan routes messages effectively instantly:
_INTENT_KEYWORDS = {
"expense": ["spent", "pay", "βΉ", "rs ", "cost", "bill", ...],
"schedule": ["schedule", "meeting", "remind", "tomorrow", ...],
"priority": ["priority", "focus", "what should i", ...],
"share": ["share", "send to", "notify", ...],
}
def _keyword_classify(message: str) -> str:
msg = message.lower()
for intent, keywords in _INTENT_KEYWORDS.items():
if any(kw in msg for kw in keywords):
return intent
return "general"
Once classified, LangGraph routes to the matching node (planner_node, expense_node, etc.), which binds the appropriate tools and runs a tool-call loop (up to 5 rounds). The LLM's system prompt always includes the caller's user_id so every tool call writes to the right user's data.
Performance on Pi
The hive-fast Modelfile tunes Gemma 2 2B with num_ctx 2048, num_thread 4, temperature 0.2 β responses arrive in 2β4 s on the Pi's ARM Cortex-A72 CPU.
A keyword intent classifier avoids an additional LLM call before the model is invoked, cutting out the extra 4β7 s that a second "classify intent" LLM call would cost.
Voice pipeline
Whisper's base.en model runs as a subprocess via openai-whisper (not faster-whisper, which has a C extension that fails to build on Python 3.13 + aarch64 + FFmpeg 6.x). Audio is uploaded as WebM, converted by ffmpeg, and transcribed in ~2 s.
Why Does Open Innovation Matter?
A closed API version of this β GPT-4o + a hosted database β would cost money every month and would mean every family member's schedule, spending habits, and daily priorities live on someone else's server.
Open weights made it possible to run a capable model on a βΉ7,000 single-board computer that sits on a shelf and consumes 5β8 W. The entire stack β model weights, inference runtime, agent framework, voice transcription β is open source. That means:
- Privacy: no application data needs to leave the home network.
- Cost: the ongoing infrastructure cost is essentially electricity.
- Longevity: no API key to rotate, no service to deprecate, no pricing change to break the family's workflow.
-
Customizability: the
Modelfilelets us tune the model's personality, context size, and stop tokens without touching the inference server.
Open innovation didn't just make this cheaper β it made it possible to build a private AI assistant that can live in the home.
My Agent Session
Built with Claude Code β iterative development over multiple sessions: architecture β scaffolding β Pi deployment β bug fixes β performance tuning.
Prize Categories
Gemma β Best Use of Gemma π
Hive runs Gemma 2 2B as its core reasoning model β fully locally on a Raspberry Pi 4B, with no cloud LLM calls or API key required.
The model is loaded via Ollama and wrapped in a custom Modelfile (hive-fast) that tunes it for the Pi's constraints:
FROM gemma2:2b
PARAMETER num_ctx 2048 # fits chat history + tool responses
PARAMETER num_thread 4 # all 4 Pi CPU cores
PARAMETER temperature 0.2 # decisive, low-variance answers
PARAMETER repeat_penalty 1.1
PARAMETER stop "<end_of_turn>"
Gemma 2 2B handles all three AI tasks in Hive:
-
Agentic tool calls β understands the user's natural-language request and generates the arguments needed for tools such as
log_expense,create_event, andget_open_tasks - Priority scoring β reads a JSON list of upcoming events and expenses, scores each 0β1 by urgency and deadline proximity
- General conversation β answers follow-up questions and summarises the day
The keyword classifier routes intent without another LLM call, so Gemma only needs to run for the actual reasoning/tool-use step.
On Pi 4B (ARM Cortex-A72, 4 cores, 8 GB), first-token latency is typically 2β4 s β fast enough for a family assistant that people can use throughout the day.
Architecture at a Glance
ββββββββββββββββββββ
β Family Device β
β Phone / Laptop β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β FastAPI β
β Hive Backend β
ββββββββββ¬ββββββββββ
β
ββββββββββΌββββββββββ
β Keyword Intent β
β Classifier β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β LangGraph β
β Agent Orchestratorβ
ββββββββββ¬ββββββββββ
β
ββββββββββΌββββββββββ
β Gemma 2 2B β
β Ollama β
ββββββββββ¬ββββββββββ
β
ββββββββββΌββββββββββ
β Hive Tools β
β Events / Expense β
β Priorities / etc β
ββββββββββ¬ββββββββββ
β
ββββββββββΌββββββββββ
β SQLite β
β Local Storage β
ββββββββββββββββββββ
Final Thoughts
Hive started with a simple idea:
Build something useful for the people around me, not just another AI demo.
It became an experiment in:
- Local AI
- Small Language Models
- Agentic workflows
- Raspberry Pi inference
- Voice AI
- Privacy-first software
- Multi-user AI systems
- Open-source infrastructure
And most importantly, it became something my family can actually use.
AI doesn't always need a data center. Sometimes it can live on a Raspberry Pi sitting on a shelf at home. π
Links
π GitHub: https://github.com/kondekarshubham123/Hive
π₯ YouTube Demo: https://youtu.be/ykFI4QWlZVs
π Hacktoberfest Challenge: https://dev.to/challenges/hacktoberfest-weekend-2026-10-01
Top comments (0)