Counterparties: auto-extract from uploaded documents

↗ view on GitHub · Custos · 2026-05-04 · 5d6cc8e1

- New lib/counterpartyExtraction.ts: maybeAutofillCounterparty() runs an
  LLM call on the doc's text to identify the counterparty (and parent
  entity) using the project's role hint (buyer/seller/mutual).
- Move extractPdfMarkdown/extractDocxMarkdown to lib/textExtraction.ts so
  both tabular review and counterparty extraction share them.
- Document upload fires the extractor fire-and-forget for templated
  projects with no counterparty set. Never overwrites manual values.
Repository Custos/legalos
Author Custos <jfeinblum@gmail.com>
Authored
Parents e7a3d0c9
Stats 4 files changed , +248 , -62
Part of Counterparties + customer index (CLM core)

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-5d6cc8e1.md from inside the repo you want the change in.

⬇ Download capture-commit-5d6cc8e1.md