DEV Community

Shubham Kondekar
Shubham Kondekar

Posted on AI-assisted

Hive - A Local AI Life Assistant for My Family, Running on a Raspberry Pi

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🀝

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>:8000 to 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
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

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 Modelfile lets 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>"
Enter fullscreen mode Exit fullscreen mode

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, and get_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  β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

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)