inhouse

Inhouse

A desktop mail reader that sorts your Gmail with a language model running on your own computer.

Inhouse downloads your mail to a local database, asks a small local model a few questions about every message, and then lets you filter, read and ask questions about your mail using the answers. It comes with six questions (what kind of mail it is, whether you have to do something, by when, how much money it is about, how important it is, and a one-line summary), and you can change them, remove them or add your own.

Your mail is read from Gmail and stays on your computer. No mail text is sent to any AI service: the model is a file on your disk and runs in a local process.

Status: early development. It has been used on macOS with Apple Silicon and on nothing else so far. Builds for that platform, when one has been published, are on the Releases page; otherwise run it from source.

Contents

What it does today

The app walks you through three setup steps and then opens on three screens.

Setup

  1. Connect Gmail. Sign-in happens in your own browser, with Google’s sign-in page. Inhouse asks for read-only access to messages and nothing else (see the scope).
  2. Choose a model. Inhouse looks at your computer’s memory and processor, recommends one of five models, and downloads the one you pick. The download can be interrupted and continued, and the file is checked against a known SHA-256 before it is used.
  3. Choose how far back to go. Last day, week, month, year, ten years, or everything. Inhouse then downloads those messages in the background. The download can be paused, and it carries on where it stopped after a restart.

Mail screen

Status screen

Settings screen

What it does not do

Knowing this is useful before you ask for something.

What the model is asked

Out of the box, every received message gets these six answers. They are what you filter on.

Question Answers
category personal, work, transaction, bill, account, newsletter, promotion, social, other
action reply (a person is waiting for an answer), do (pay, sign, confirm, book, fill in), read, none
deadline A date, only when the message gives one
amount A sum of money and its currency, when the message is about one
importance low, normal, high
summary One short sentence, in Hebrew for Hebrew mail and in English otherwise

What the model reads for each message: your address, the date, sender, recipients, subject, a few hints (sent in bulk, which Gmail tab, attachment names) and roughly the first 600 tokens of the cleaned text. Links, quoted replies and invisible padding are removed first.

Drafts, chat transcripts and mail you sent are stored but not analyzed.

The built-in questions and their wording are in src/shared/default-definition.ts. The text the model is given is put together from them in src/main/analysis/compile.ts, and Settings → Prompt shows it in full.

Changing the questions

Settings → Questions is where the questions are edited. Nothing changes until you press Save.

A question has a name, a sentence telling the model what to answer, and one of six kinds of answer:

Kind The answer
One of a list Exactly one of the answers you list. Each has a name, an optional note on when to choose it, and a colour.
Free text A short text, up to a length you set, in the language of the message, in English or in Hebrew
A date A date, or nothing
A sum of money An amount and its currency, or nothing
A number A number, or nothing
Yes or no Yes or no

Names and answers can be in any language. Up to 12 questions can be asked at once; a question can be turned off without deleting it. For each question you also choose where its answer shows: in the mail list, in the counts on the Status screen, and in what the conversation is given.

Next to the questions you can change the opening instructions, how much of a message the model reads, which hints it gets, and which mail is skipped. The settings screen shows how long one message is expected to take with the questions as they are.

Saving can delete every answer. The answers were given to the old questions, so when what the model is asked changes, Inhouse deletes all of them and analyzes the mail again from the start. There is no partial update. The save bar says which it will be before you press Save, and a deleting save asks you to confirm.

Change Answers
A question’s name, wording or kind; an answer’s name or note; adding, removing or reordering answers Deleted
Adding, removing, reordering, or turning a question on or off Deleted
The instructions, how much text is read, the hints, which mail is skipped Deleted
Switching to another model Deleted
Where an answer shows, an answer’s colour, hiding an answer from the list Kept
Editing, adding or removing a question that is turned off Kept
The conversation settings Kept

Analyzing again takes as long as the first time: about 5 seconds a message on the computer described under Speed and limits. Try it is there so you can see what a change does on a few messages before paying that price.

Export writes the questions to a JSON file, and Import reads one into the editor, where it still has to be saved. The file holds the questions and settings only, no mail and no answers. Built-in questions puts the original six back.

Requirements

To use a downloaded build:

To run it from source, also:

Which Google client sign-in goes through

Signing in to Google always goes through a Google Cloud “OAuth client”, which tells Google which app is asking.

The client can be changed only while no mailbox is connected, because a mailbox’s sign-in works only with the client it was made through.

Google Cloud setup

This is needed when you run from source, or when you want a downloaded build to sign in through your own client. You do it once. It takes about ten minutes in the Google Cloud console. Google renames the pages in this area from time to time, so the names below may differ slightly.

  1. Create a project. Any name will do.
  2. Enable the Gmail API for the project: APIs & Services → Library → Gmail API → Enable.
  3. Set up the OAuth consent screen (also called Google Auth Platform):
    • User type: External.
    • Fill in an app name and your email address where asked.
    • Leave the publishing status at Testing.
    • Under Test users (Audience), add the Gmail address you are going to connect. In Testing, only the addresses listed here can sign in.
  4. Add the scope (Data Access → Add or remove scopes): https://www.googleapis.com/auth/gmail.messages.readonly
  5. Create the OAuth client: Clients → Create client → Application type Desktop app. Copy the client ID and the client secret.
  6. Give them to Inhouse, in one of two ways:
    • In the app: on the connect screen, choose Use your own Google client and enter the two values. They are kept on your computer, the secret encrypted.
    • From source: in the project folder, copy .env.example to .env and fill in the two values. They are then compiled into what you build.

      MAIN_VITE_GOOGLE_CLIENT_ID=...
      MAIN_VITE_GOOGLE_CLIENT_SECRET=...
      

      .env is ignored by git. Do not commit it.

The scope Inhouse asks for

Scope What it allows Why
https://www.googleapis.com/auth/gmail.messages.readonly Reading messages. Nothing can be sent, changed or deleted. Downloading your mail
openid, email Learning the address of the account that signed in Showing which mailbox is connected

That is the whole list. It is deliberately the narrowest access that lets the app read mail.

Things to know about Testing mode

Run it from source

npm install
npm run dev

npm run dev opens the app with live reload. To build it and run the built version:

npm run build
npm start

npm run typecheck checks the types without building.

npm test

runs the tests. They use made-up mail and a stand-in for the model, need no Google account, and finish in a few seconds.

npm run eval

runs the built-in questions on the made-up messages in tests/fixtures/mail.ts with the real model you downloaded, and prints how often the answers match what a careful reader would say. It takes a couple of minutes and is the way to check a change to the wording or to the way the prompt is put together.

Packaging a build

For making a build that others can download. macOS on Apple Silicon only.

npm run dist:mac

This builds the app and packages it into dist/ as a .dmg and a .zip, signed with the “Developer ID Application” certificate in your keychain.

npm run release:mac

The same, and it also sends the app to Apple for notarization, so that macOS opens it without a warning. It expects notarization credentials saved in the keychain under the name inhouse-notary:

xcrun notarytool store-credentials "inhouse-notary" --apple-id "YOUR_APPLE_ID" --team-id "YOUR_TEAM_ID"

Things to know before handing a build to someone:

Models

Models are GGUF files downloaded from Hugging Face, each pinned to an exact revision and checksum. The app recommends one from your computer’s memory; you can pick another.

Model Download Suggested memory
Qwen 3.5 4B 3.0 GB 8 GB
Qwen 3.5 9B 5.7 GB 16 GB
Gemma 4 E2B 3.3 GB 8 GB
Gemma 4 E4B 5.2 GB 16 GB
Gemma 4 12B 7.0 GB 24 GB

The model runs through node-llama-cpp in a process of its own, and is unloaded after a few idle minutes.

More than one model can be on disk, and Settings → Model switches between them. Another model answers differently, so switching deletes every answer and the mail is analyzed again; the app asks first. Downloading a model does not switch to it.

So far only Qwen 3.5 9B has been used for real work. The others download and are expected to work, but their answers have not been checked.

Each model comes with its maker’s license, which is shown on its Hugging Face page.

Where your data lives

Everything is in one folder:

System Folder
macOS ~/Library/Application Support/inhouse/
Windows %APPDATA%\inhouse\
Linux ~/.config/inhouse/
File Contents
mail.sqlite Your downloaded mail, the model’s answers, and your questions and settings. Not encrypted.
accounts.json The connected mailboxes and their sign-in tokens, encrypted with your system’s keychain
google-client.json Your own Google client, if you entered one; the secret is encrypted the same way
models/ The downloaded model files

The look of the window (light or dark, its colour, the height of the conversation area) is kept with the window’s own settings in the same folder.

To remove everything, disconnect the mailboxes in Settings → Mailboxes and delete the folder.

The only places Inhouse connects to are Google (sign-in and the Gmail API) and Hugging Face (downloading the model). There is no telemetry and no server of ours. More in SECURITY.md.

Speed and limits

Measured on a MacBook Pro with an M3 Pro and 36 GB of memory, with Qwen 3.5 9B:

Known rough edges:

Feature requests and bug reports

Open an issue. A request is easiest to act on when it says:

  1. What you were trying to do, in terms of your mail. “Find every bill I have not paid this month” says more than “add a paid filter”.
  2. What Inhouse does today, and where it fell short. Name the screen and the filter or field involved.
  3. What you expected to see instead.
  4. Which part it touches, if you know:
    • what is downloaded (for example new mail, attachments)
    • what the model is asked. You can change the questions yourself in Settings, so say what the editor would not let you do, or attach the file from Settings → Questions → Export if the built-in questions should change
    • filtering and reading
    • the conversation with the model
    • setup (connection, models, platforms)
  5. For a bug: your system, the model you chose, and what you did just before.

Two things to keep in mind:

Security problems do not belong in public issues; see SECURITY.md.

Project layout

Electron, TypeScript and Solid. The main process does all the work; the window only shows it.

src/
  shared/            Types shared by both sides; the questions and their rules
  main/              Main process
    providers/gmail/   Sign-in and the Gmail API client
    accounts/          Connected mailboxes and their encrypted tokens
    models/            Model list, hardware check, download
    mail/              Download to SQLite; queries for the mail screen
    analysis/          Turning the questions into a prompt and an answer
                       format, the queue, the model process, chat
    db/                Database schema and migrations
  preload/           The narrow bridge between the window and the main process
  renderer/          The window: setup steps, mail, status and settings screens
tests/               Tests, with made-up mail in tests/fixtures
scripts/eval.ts      Runs the questions on the made-up mail with the real model
docs/specs/          Design documents

Security

See SECURITY.md for what is stored, what protects it, what does not, and how to report a problem.

Privacy and terms

License

MIT

The window’s typeface is Rubik, under the SIL Open Font License 1.1. It is packaged with the app from the @fontsource-variable/rubik package, so nothing is fetched for it when the app runs. Its licence is in src/renderer/public/licenses/Rubik-OFL.txt and goes into every build.