Metadata-Version: 2.4
Name: kiwime
Version: 0.1.0
Summary: Compile a person into AI-readable expert context. Local-first web runtime + MCP server.
Project-URL: Homepage, https://github.com/kiwiberry-ai/kiwime
Project-URL: Documentation, https://github.com/kiwiberry-ai/kiwime/tree/main/docs
Project-URL: Changelog, https://github.com/kiwiberry-ai/kiwime/blob/main/CHANGELOG.md
License-Expression: Apache-2.0
Keywords: ai,context,knowledge-graph,local-first,mcp,memory
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115
Requires-Dist: kiwime-compiler==0.1.0
Requires-Dist: kiwime-connector-gdrive==0.1.0
Requires-Dist: kiwime-connector-github==0.1.0
Requires-Dist: kiwime-connector-gmail==0.1.0
Requires-Dist: kiwime-connector-local-files==0.1.0
Requires-Dist: kiwime-connector-mcp-client==0.1.0
Requires-Dist: kiwime-connector-notion==0.1.0
Requires-Dist: kiwime-connector-slack==0.1.0
Requires-Dist: kiwime-export==0.1.0
Requires-Dist: kiwime-sdk==0.1.0
Requires-Dist: kiwime-secret==0.1.0
Requires-Dist: kiwime-store==0.1.0
Requires-Dist: uvicorn>=0.34
Description-Content-Type: text/markdown

# kiwiMe web host

Run kiwiMe as a local web app — a background service on `127.0.0.1` plus a
browser UI — instead of the Tauri desktop shell. This is the primary
distribution for developers and technical users (no code signing, no native
installer): you start a service and open a browser.

It is **local-first**: the service binds to loopback only, and all data
(credentials, content, indexes) stays on your machine, exactly as in the
desktop app. The host runs every sidecar *in-process* — there are no child
processes and no stdio plumbing; see `docs/release/webification-plan.md`.

## Run from a checkout (current)

Prerequisites:

- [uv](https://docs.astral.sh/uv/) (Python package manager)
- Node ≥ 20 **and [pnpm](https://pnpm.io/installation)** — the easiest way to
  get pnpm is `corepack enable` (ships with Node), or
  `npm install -g pnpm`.
- Python ≥ 3.11 with SQLite loadable-extension support (standard CPython
  builds have it).

```bash
# 1. install the Python workspace (all sidecars + the host)
uv sync --all-packages -p 3.12

# 2. build the frontend once (served as static files by the host)
cd apps/desktop && pnpm install && pnpm build && cd -

# 3. start the host — opens http://127.0.0.1:8765 in your browser
uv run kiwime
```

If you skip step 2, the host still starts and serves the API, and shows a
"UI not built" page with these instructions instead of the app.

Options:

```
kiwime [--host 127.0.0.1] [--port 8765] [--db PATH] [--no-browser]
```

- `--db PATH` — use a specific store SQLite file (default: the platform app
  data dir, the same one the desktop app uses).
- `--no-browser` — don't auto-open a browser. The startup log prints an
  authenticated `…/auth?token=…` link — open that (or use the token as an
  `Authorization: Bearer` header for scripting).
- `KIWIME_DIST=/path/to/dist` — override where the built UI is served from.

### Security

The API requires a per-session token even on loopback: the browser gets it
via the `/auth?token=…` link (exchanged for an HttpOnly cookie), other
clients pass `Authorization: Bearer <token>`. Requests with a non-localhost
`Host` header or a non-JSON body are rejected. A fresh token is minted on
every start.

### Linux note

Connector credentials go to the OS keyring. On Linux this needs a Secret
Service provider (GNOME Keyring / KWallet via `libsecret`); on a headless
box or minimal WSL distro, install `gnome-keyring` (or configure another
[keyring backend](https://pypi.org/project/keyring/)) before adding sources.

## Local models

The host exposes the same one-click Ollama flow as the desktop app
(detect / download with progress). Install [Ollama](https://ollama.com/download)
and use the in-app model manager to pull Qwen3 / Gemma 3. The curated model
list lives in `shared/model-catalog.json`, shared with the desktop runtime.

## Installing as a tool (future)

`pipx install kiwime` / `uv tool install kiwime` will be the one-line
install once the packages are published to PyPI and the built UI is bundled
into the wheel. Until then, use the checkout flow above.

## How it relates to the desktop app

The React frontend and all Python sidecars are shared. Only the *host* differs:
the desktop app uses a Rust (Tauri) shell that spawns sidecars as processes;
this web host holds them in one Python process and serves the same UI over
HTTP + SSE. `apps/desktop/src/api/tauri.ts` picks the transport at runtime.
