# Kiwix

Kiwix serves offline copies of Wikipedia, Project Gutenberg, iFixit and other books. This shows the books with their article counts and a random article with its first paragraph, a new one each hour, and puts the library in ⌘K's search. The assistant can search it and read an article to answer from, with the link to cite.

## Set it up

```yaml title="config.yaml"
integrations:
  kiwix:
    type: kiwix
    url: http://10.0.0.20:8080
    href: https://library.example.com

layout:
  - title: Apps
    widgets:
      - kiwix.library
```

| Option | Type | Default | What it does |
|---|---|---|---|
| `url` | URL | required | where kiwix-serve answers, from Valet's side |
| `href` | string | optional | where articles open, when that differs from url |
| `books` | list of string | optional | only these books, by name (wikipedia_en_all_maxi, ifixit_en_all) or as in their address; every book by default |
| `random` | string | optional | the book the Random article card picks from: Wikipedia if there is one, else the biggest |
| `headers` | map of string | `{}` | sent with every request, for a server behind basic auth or a proxy: { Authorization: "Basic ${KIWIX_AUTH}" } |

## Widgets

2 widgets. Each key starts with your instance name, here `kiwix`.

### Library

`kiwix.library` · [list](/cards/list/) card · refreshes every 30 minutes while the page is open.

#### States

### Random article

`kiwix.random` · [article](/cards/article/) card · refreshes every hour while the page is open.

#### States

## Assistant tools

What the assistant can use, once its [access level](/assistant/access/) allows it. Read tools run freely. Everything else asks first.

| Tool | Access | What it does |
|---|---|---|
| `kiwix_search` | read | Search the homelab's offline library (Kiwix: copies of Wikipedia, WikiMed, iFixit repair guides, Project Gutenberg books and the like, whichever are installed) for articles. |
| `kiwix_read` | read | Read one article from the homelab's offline library (Kiwix) as plain text, to answer from it and cite it. |

</div>