diff --git a/README.md b/README.md index 83eaa72..05c7463 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,39 @@ **Extraction you can audit.** Define a Zod schema, feed it a PDF or image, get back schema-validated JSON where every field carries provenance — the page and bounding box it came from — plus a confidence score. -> **Status: in development.** The core library ([`packages/core`](./packages/core)), the eval harness ([`packages/evals`](./packages/evals)), and the playground ([`apps/playground`](./apps/playground)) are implemented and tested. The first live provider runs are in — the OpenAI lineup plus Google's `gemini-3.5-flash` across the CORD-v2 receipt set — validating core's live path and publishing the [benchmark](#benchmark) below. Still open: the Anthropic lineup and the rest of the Gemini tiers, the DocILE invoice half (blocked on a dataset token), and the demo GIF. See [ROADMAP.md](./ROADMAP.md). +> **Status: v0.1.** The core library ([`packages/core`](./packages/core)), the eval harness ([`packages/evals`](./packages/evals)), and the playground ([`apps/playground`](./apps/playground)) are implemented and tested, and the [benchmark](#benchmark) below is generated from recorded live runs — the OpenAI lineup plus Google's `gemini-3.5-flash` on the CORD-v2 receipt set. Still to come: the Anthropic lineup and the rest of the Gemini tiers, and the DocILE invoice half of the benchmark (blocked on a dataset token). See [ROADMAP.md](./ROADMAP.md). + +## Quickstart + +```sh +npm install extractkit ai zod +``` + +`ai` (Vercel AI SDK v7) and `zod` (v4) are peer dependencies. Bring any AI SDK provider — `@ai-sdk/anthropic`, `@ai-sdk/openai`, `@ai-sdk/google`, … — and pass its model to `extract`: + +```ts +import { anthropic } from '@ai-sdk/anthropic'; +import { extract } from 'extractkit'; +import { readFile } from 'node:fs/promises'; +import { z } from 'zod'; + +const invoice = z.object({ + vendor: z.string().describe('Legal name of the issuing company'), + invoiceNumber: z.string(), + total: z.number(), +}); + +const result = await extract({ + schema: invoice, + document: { data: await readFile('invoice.pdf') }, + model: anthropic('claude-sonnet-5'), +}); + +result.data.total; // 1250.5 — validated against the schema +result.fields.total; // { value: 1250.5, confidence: 0.97, page: 0, bbox: { x0: 0.72, y0: 0.81, x1: 0.9, y1: 0.84 } } +``` + +Streaming, typed failure handling, repair retries, and cost tracking are covered in the [core library docs](./packages/core/README.md). ## Why diff --git a/ROADMAP.md b/ROADMAP.md index da8b623..b86dbbe 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -30,9 +30,9 @@ Live-provider path validated via the playground and the first Phase 2 eval run ( ## Phase 4 — Release -- [ ] README final: pitch, benchmark table, demo GIF, quickstart -- [ ] MIT license -- [ ] Publish `extractkit` to npm +- [x] README final: pitch, benchmark table, demo GIF, quickstart +- [x] MIT license (repo root + shipped in the npm package) +- [ ] Publish `extractkit` to npm — package is publish-ready (tarball verified: dist + README + LICENSE, 13.5 kB); blocked on `npm login`, then `pnpm --filter extractkit publish` (human action) ## Non-goals for v1 diff --git a/packages/core/LICENSE b/packages/core/LICENSE new file mode 100644 index 0000000..97a5649 --- /dev/null +++ b/packages/core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 extractkit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/core/package.json b/packages/core/package.json index 670ecaa..4a540d8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -8,6 +8,8 @@ "url": "git+https://github.com/RATCHAW/extractkit.git", "directory": "packages/core" }, + "homepage": "https://github.com/RATCHAW/extractkit#readme", + "bugs": "https://github.com/RATCHAW/extractkit/issues", "keywords": [ "document-extraction", "ocr",