ambrosiana-document-intake/README.md

85 lines
2.7 KiB
Markdown

# Ambrosiana Document Intake
**Status:** Beta (v0.1.0)
Document intake UI for the Ambrosiana RAG library.
A minimal Textual TUI that collects the metadata needed to start a
document's journey into an Ambrosiana instance's RAG corpus. It does
not touch the pipeline, any agent, or any model — its only job is to
turn what a human knows about an incoming document into a structured
ticket that Claude Code (or a human) then acts on.
Deployed per-device: each Ambrosiana instance gets its own copy, and an
intake ticket always targets that device's own RAG — there is no
cross-device routing field.
![Ambrosiana Intake App](ambrosiana-intake-app.png)
## Requirements
- Python 3.11+ (uses stdlib `tomllib`)
- `textual` (see `requirements.txt`)
```bash
pip install -r requirements.txt
```
## Running
```bash
python3 ambrosiana_intake.py
```
## Configuration
The ticket output directory is read from
`~/.config/ambrosiana-intake/config.toml` (`tickets_root` key). If the
config file doesn't exist yet, it's created automatically on first run
with a default of `~/documents/rag-administration/ticket-queue`. Edit
the file directly to point at a different location.
## Fields
| Field | Required | Type | Notes |
|---|---|---|---|
| Source location | Yes | filepath or URL | |
| Source type | Yes | `upstream-doc` \| `ce-authored` \| `ce-experience` | |
| Source tier | Yes | `primary` \| `secondary` \| `forum/unmoderated` | |
| Licence | Yes | text | |
| Priority | Yes | `immediate need` \| `add to queue` | |
| Title / description | No | text | used for the ticket filename slug if given |
| Notes / context | No | text | free-form, passed through to the ticket body |
## Output
Each submission writes a markdown file with YAML front matter directly
into the configured `tickets_root` — there are no `immediate/`/`queue/`
subdirectories; priority is encoded in the filename instead:
- Priority "immediate need" → `immediate_YYYYMMDD-HHMMSS_slug.md`
- Priority "add to queue" → `YYYYMMDD-HHMMSS_slug.md` (no tag — the
absence of a tag means normal, order-of-arrival handling)
`slug` comes from the title if provided, otherwise the source
location's basename.
On a successful save the form clears itself and a toast notification
confirms the ticket path — no need to scroll to see confirmation.
The ticket is the handoff artefact: a human (or Claude Code, on
request) picks it up from `tickets_root` and runs the actual
scrape → vet → transform → commit → index pipeline against it.
## Keybindings
| Key | Action |
|---|---|
| `Ctrl+S` | Save ticket |
| `Ctrl+N` | Clear form |
| `Ctrl+Q` | Quit |
---
*Built standing on the shoulders of billions of dwarves*
*Created by John A. Hoeven with the ethical assistance of Claude AI*