snapkitty-ocr / README.md
SNAPKITTYWEST's picture
push from SNAPKITTYWEST/snapkitty-ocr
ead7515 verified
|
Raw
History Blame Contribute Delete
2.45 kB
# SnapKitty OCR β€” The Book Ingestion App
Android app (Kotlin + Jetpack Compose) for OCR'ing Ahmad's handwritten notebooks
into THE BOOK digital corpus and feeding the results to the sovereign agent stack.
## What it does
1. **Pick images** from gallery (multi-select β€” scan a stack of pages at once)
2. **Camera mode** β€” capture live from phone camera
3. **Google ML Kit OCR** β€” on-device, offline, no API key, Latin + handwriting
4. **Tag each batch** by chapter (THE_BOOK_CH3, MOTHERS_POEM, etc.)
5. **WORM-seal** each page with SHA-256 hash + timestamp
6. **Push to agents**:
- `snapkitty-shell :3700` β†’ `/ocr/ingest` β†’ triggers THE_BOOK workflow
- `ROBOB :4600` β†’ `/ocr/book_page` β†’ Brain analysis via Bedrock
- `ABZU IDE :4000` β†’ `/api/book_page` β†’ live feed in Phoenix LiveView
## Install
1. Open in Android Studio (Electric Eel or newer)
2. Connect Android device or start emulator
3. `./gradlew installDebug`
## For real device (not emulator)
In `AgentBridge.kt`, replace `10.0.2.2` with your machine's LAN IP:
```kotlin
private val SHELL_URL = "http://192.168.1.X:3700/ocr/ingest"
```
## Chapter Tags
Use consistent tags so THE BOOK assembles correctly:
```
THE_BOOK_CH1 β€” Master Toltec Mitote
THE_BOOK_CH2 β€” A Patient Mind
THE_BOOK_CH3 β€” Past Present Future
THE_BOOK_CH4 β€” Mastery of Intelligence
THE_BOOK_CH5 β€” Sacred Taxonomy
THE_BOOK_CH6 β€” Mothers Poem (poetry only β€” no code)
THE_BOOK_CH7 β€” Soul to Code
THE_BOOK_CH8 β€” Agent Illumination Protocol
THE_BOOK_NEW β€” New pages not yet assigned to a chapter
```
## Architecture
```
Android App (Kotlin)
β”œβ”€β”€ OcrProcessor.kt β€” ML Kit text recognition, SHA-256 WORM hash
β”œβ”€β”€ AgentBridge.kt β€” HTTP push to shell/ROBOB/ABZU (graceful degradation)
└── MainActivity.kt β€” Compose UI: gallery picker + camera + results list
Sovereign Stack (receives)
β”œβ”€β”€ snapkitty-shell β€” indexes page into THE_BOOK corpus
β”œβ”€β”€ ROBOB β€” Brain (Claude Sonnet 4.6 Bedrock) analyzes page
└── ABZU IDE β€” live feed in GITLAB tab (or new BOOK tab)
```
## WORM Seal Format
Each page is hashed as: `SHA-256(tag:pageIndex:timestamp:ocrText)`
The first 16 hex chars become the `worm_hash` displayed in the app and sent to agents.
⬑ Ξ© β†Ί Ξ¨ Ξ” Ξ› Ξ£ Ξ¦ Ξ±
SnapKitty Collective Β· 2026