|
|
AI Document Summariser
Author: Venkata Sudhakar
A typical vendor contract, legal agreement, or business proposal runs 30-50 pages. An executive needs a 1-page brief. A procurement manager needs the key commercial terms. A lawyer needs the liability clauses highlighted. Reading the full document each time is not practical when you receive dozens per week. An AI document summariser reads the entire document and produces a structured, role-specific summary in seconds - the same document can produce a 5-bullet executive brief, a detailed clause-by-clause breakdown for legal, and a commercial terms sheet for finance, all from one pipeline. Long documents exceed the LLM context window, so a direct summarise-everything approach fails for documents over 20-30 pages. The map-reduce pattern solves this: first map each chunk of the document to a short chunk summary, then reduce all chunk summaries into a final cohesive brief. LangChain provides this as a built-in chain (load_summarize_chain with chain_type="map_reduce"), but you can also build it explicitly with LCEL for full control over the prompts at each stage - giving you different summaries for different audiences from the same source document. The below example summarises a long vendor software contract using the map-reduce pattern, then produces three role-specific views: an executive brief, a commercial terms sheet, and a risk flag list for legal.
Map-reduce summarisation with three role-specific outputs,
It gives the following output,
=== EXECUTIVE BRIEF ===
- PURCHASE: 3-year cloud inventory management software from TechVendor Solutions
- COST: Rs 24L/year license + Rs 5L one-time implementation = ~Rs 77L over 3 years
- DURATION: 3 years with 90-day termination notice permitted after Year 1
- KEY RISK: Vendor liability capped at 6 months fees - limited recourse for major failures
- KEY BENEFIT: Full data ownership, perpetual licence for custom modules, uptime SLA
=== COMMERCIAL TERMS ===
Annual Fee: Rs 24,00,000 (paid quarterly in advance)
Implementation Fee: Rs 5,00,000 (50% on signing, 50% on go-live)
Support: Included in Year 1; Rs 2,40,000 p.a. from Year 2
Price Escalation: Capped at 8% per year from Year 2
SLA Uptime: 99.5% monthly; credits up to 30% of monthly fee
Termination Notice: 90 days written notice after Year 1
Early Exit Penalty: 3 months fees if terminated without cause in Year 1
=== LEGAL RISK FLAGS ===
1. LIABILITY CAP: Vendor liability limited to 6 months of fees paid - inadequate
for a critical system failure causing major business loss.
2. NO CONSEQUENTIAL LOSS: No recovery for lost profits, reputation damage,
or business disruption even if caused by Vendor negligence.
3. FORCE MAJEURE: 30-day threshold is generous to Vendor - could block SLA credits
during extended outages framed as force majeure events.
4. TERMINATION CURE WINDOW: 30 days to cure material breach may be too long
if breach involves a data security incident.
The same pipeline works for any long business document: board meeting minutes, tender documents, annual reports, HR policies, or insurance certificates. The map step is fast and cheap because chunk summaries are short. The reduce step is where your business-specific prompt makes the difference - the more specific your questions about what to extract, the more useful the output. For a procurement team handling 50 contracts per month, this pipeline replaces 200+ hours of reading time with a 10-minute automated review.
|
|