Halvik Kathmann Labs

A Kathmann Labs project

Ask the mesh. Get an answer back.

Halvik is a computer that sits on a Meshtastic radio mesh and answers text messages. Send it a place and it replies with turn-by-turn directions. Ask what's nearby and it lists the closest hospitals, water or fuel. Ask a question and an offline AI looks it up in more than 160 GB of reference material. Neither end needs cell service or the internet.

  • 0internet connections
  • 200characters per message
  • 250 GBon one portable SSD
HalvikHLVK · direct message
  1. near hospital
  2. 1 Floating Hospital for Children, Boston 0.4mi S | 2 Tufts Medical Center, Boston, MA 0.4mi S | 3 Shriners Hospitals for Children - Boston 0.6mi N Reply # for route164/200
  3. 2
  4. Tufts Medical Center, Boston, MA: 0.5mi 2min drive. 1.Head S on Tremont St 0.2mi 2.L Stuart St 510ft 3.R Washington St 0.2mi 4.Arrive (on R)140/200
Real replies from the gateway, with the sender's position set to Boston Common.

The problem

When the network goes down, the radios keep working. The information people need doesn't come with them.

A bad storm, a multi-day power outage, a weekend in the mountains. They all end the same way: no cell signal, no internet, and a phone that can't look anything up.

Meshtastic solves part of that. Inexpensive LoRa radios pair with a phone over Bluetooth and pass short text messages to each other, hopping from node to node across miles with no towers, carriers or accounts.

A mesh only carries what people type into it, though. If nobody in range knows the way to the nearest hospital, how to warm up someone who's too cold, or where to find drinking water, the radio can't tell you. And every message has to fit in about 200 characters.

Halvik puts a reference desk on the mesh: one node anyone in range can message, backed by a computer with maps, routing for the whole United States, a large offline library and a local AI model.

Using it

Send a direct message to the node named Halvik

Commands are answered in a second or two. Anything that isn't a command goes to the AI. Halvik only replies to direct messages; channel chatter is logged but never answered. The first time a node writes in, it gets a one-message introduction.

dir <place>Directions

A route from your shared position. Put walk, bike or hike in front to change the mode, or send dir <from> to <place> to start somewhere else. A place can be a name, an address, lat,lon, or a saved name. Long routes continue with more.

bike dir faneuil hall

Faneuil Hall, Boston, MA: 1.3mi 8min bike. 1.Head S on Tremont St 0.2mi 2.L Boylston St 0.2mi 3.L Chauncy St 0.4mi 4.R Milk St 0.2mi 5.L Broad St 480ft 6.L State St 230ft 7.R Merchants Row 180ft194

8.R Chatham St 0.1mi 9.L Commercial St 130ft 10.L S Market St 0.1mi 11.Arrive77

near <thing>Nearby

The closest three, with distance and compass direction. Works for water, hospital, clinic, pharmacy, fuel, food, hardware, police, fire, shelter, camp, toilet, trailhead, town, or any name. Reply with a number to get a route there.

near water

1 Perkins & Jamaicaway drinking fountain 3.5mi SW | 2 Quarry Spring, Medford, MA 5.9mi N | 3 Pakomet Spring, Quincy, MA 10mi S Reply # for route144

whereLocate

The nearest address and town for your shared position, plus coordinates. Handy when you need to tell someone exactly where you are.

where

You are at Boston Common, Boston, MA. 3.1mi NE of Brookline ctr. 42.35500,-71.0656083

anything elseAsk the AI

Plain questions go to the offline model. It answers from its own knowledge, or looks things up in the library, the maps, or your position first. Replies take up to about a minute.

what are the signs of heat stroke

Heat stroke signs include: body temperature over 104°F (40°C), red and hot skin, confusion, headache, dizziness, and lack of sweating (classic) or sweating (exertional). Onset may be sudden or192

gradual. Additional signs are high heart rate, seizures, and possible kidney failure or muscle breakdown. Get professional help if you can. [Src: Heat stroke]158

help more 1 2 3The rest

more sends the next steps of a long route. When a place name matches several spots, Halvik replies with a numbered list and you answer 1, 2 or 3. Directions need position sharing turned on in the Meshtastic app, and Halvik tells you when your last position is stale.

help

Halvik cmds: dir <place> | dir <from> to <place> | walk/bike/hike dir .. | more | where | near water/hospital/fuel/food/shelter | about135

Anything else goes to Halvik's offline AI. It answers from its own knowledge and checks the library, maps or your position when needed (up to 1 min).149

Places: names, lat,lon or saved names. dir uses your shared GPS. Map data is offline OSM; verify before relying on it.118

How it works

A radio, a Python gateway, and a stack of offline services

Everything runs on one Mac with a Meshtastic radio plugged in over USB and a Samsung T7 SSD holding the data. The services run in Docker; the gateway runs natively, because Docker on macOS can't reach USB serial devices.

  1. You send a direct message. Your radio relays it across the mesh until it reaches the Halvik node, which hands it to the gateway over USB.
  2. The gateway decides what it is. dir, near, where and the other commands are parsed directly and sent to Valhalla or Photon. Everything else is queued for the AI.
  3. The AI answers, or looks it up. It can search the library, read an article or PDF page, ask for a route, find nearby places, or check where you are. Up to three rounds of lookups.
  4. The reply is packed for radio. Street names get abbreviated (Street to St, Turnpike to Tpke), steps get numbered, and the text is split into at most three 200-character parts.
  5. It goes back over the mesh. Parts are sent four seconds apart so they arrive in order, each with a delivery acknowledgment. Failed sends are retried.

It starts on its own

At login, a launch agent waits for the SSD and Docker, mounts the map disk image, starts the services, and then runs the gateway. If the gateway stops, it's restarted.

A home page on the local network

The same machine serves a small site on the LAN: library and PDF search, an offline map with directions, and a live viewer that shows every message in and out along with each AI tool call.

The AI

A local model with rules about when to look things up

Questions go to Qwen3 30B-A3B, a mixture-of-experts model quantized to 4 bits and running on the Mac's CPU through Ollama. It answers general questions from what it already knows. When it needs facts, it calls tools that query the same offline services the commands use.

A small model on a CPU can be wrong, so the gateway doesn't leave everything to the model. The system prompt sets the rules below, and the parts that matter most are enforced in code.

  • search_library full-text search across Kiwix and the PDF shelf, plus title matching
  • read_article read a search hit: an article's opening or one PDF page
  • get_directions route through the gateway's own dir command
  • find_nearby closest places by category or name
  • where_am_i the sender's shared position
What happened behind the heat stroke answer above (70 seconds)
Q: what are the signs of heat stroke
tool: search_library(query='heat stroke signs')
      → 1. What are the first signs that you are headed for heat
           exhaustion…  (The Great Outdoors Q&A)
tool: read_article(number=2)
      → Heat stroke  (MDWiki): "Heat stroke, also known as sun stroke,
        is a type of severe heat illness that results in a body
        temperature greater than 40.0 °C (104.0 °F) and confusion…"
A (351 chars): Heat stroke signs include: … [Src: Heat stroke]

Look it up first

For medical doses, first aid, poisons, wild plants, regulations and repair specifics, the model must search the library before it answers, and read the best article when the snippet isn't enough.

Routes are never reworded

Directions come from the router through the same dir command a person would send, and the steps go back exactly as Valhalla produced them.

Sources come from code

A [Src: …] tag is added only when an article was actually read. Any source tag the model writes on its own is stripped out.

No guessing where you are

Location comes only from the position your radio shared. With no position, Halvik asks you to turn on sharing.

Bounded

Three rounds of tool calls at most, so answers take about 5 to 70 seconds. The last two exchanges per person are kept for 30 minutes so follow-up questions make sense.

What's on the drive

About 250 GB that works without a connection

  • 139 GBLibrary69 Kiwix archives
  • 52 GBRoutingValhalla tiles, whole US
  • 24 GBPDF shelf110,000+ pages indexed
  • 20 GBLanguage modelQwen3 30B-A3B, 4-bit
  • 14 GBPlace searchPhoton, whole US
  • 1.1 GBBasemapNew England, PMTiles

Reference

Wikipedia (English, text only), Simple English Wikipedia, Wikibooks, Wikisource, Wikiversity, Wikivoyage, Wikispecies, Simple English Wiktionary, Vikidia, the CIA World Factbook.

Medicine

WikiMed, MDWiki, MedlinePlus, CDC Travelers' Health, military medicine manuals, LibrePathology, Quick Guides for Medicine, WikiVet, StatPearls clinical reviews, and Hesperian's Where There Is No Doctor and companion books.

Preparedness

Ready.gov, the UK's Be Ready campaign, US Army publications, curated collections on water, food preparation, medicine, knots and post-disaster recovery, Appropedia, Energypedia and the CD3WD appropriate-technology library.

Fixing and making

iFixit repair guides, the Navy's 24-module NEETS electronics course, and Stack Exchange archives for DIY, mechanics, woodworking, electronics, engineering, robotics and ham radio.

Food and growing

Two open cookbooks, Gardenology, and the cooking, gardening, homebrewing and sustainability Stack Exchanges.

Learning

84 OpenStax textbooks, 13 LibreTexts libraries, 13 MIT OpenCourseWare courses (calculus through circuits and Python), PhET science simulations, and Stack Exchange archives for math, physics, chemistry and biology.

The PDF service pulls the text out of every page and indexes it in SQLite FTS5, checking for new files every five minutes, so the AI's library search covers the books as well as the Kiwix archives.

Status

Where the project stands

Working now

  • Mesh gateway answering commands and AI questions
  • Routing and place search for the whole US
  • 69-archive library and PDF shelf with full-text search
  • Local home page, offline map and live message viewer
  • Starts at login and restarts itself

Next

  • Khan Academy through Kolibri
  • A US-wide basemap for the map page (it shows New England today; routing already covers the US)
  • A rail-corridor tileset
  • Finishing the StatPearls download and index

What it isn't

  • Not an emergency service. Call 911 when you can.
  • Map data is an OpenStreetMap snapshot. Check it before you rely on it.
  • The AI can be wrong. Treat it as a reference desk, not a doctor.
  • It answers one AI question at a time, and only within radio range of its mesh.

Built on open source

Credit where it's due