Enterprise organizations generate over 2.5 quintillion bytes of unstructured data every single day, yet most of it sits in PDFs, emails, and HTML pages that traditional databases cannot parse. LangChain's open-source extraction service, now archived at 1,200 GitHub stars, offered a glimpse at a future where any document can be turned into structured JSON on the fly using nothing but a schema definition and an LLM. While the repository is no longer maintained, its architecture remains one of the most practical blueprints for founders building data ingestion pipelines, RAG systems, and agentic document processing workflows in 2026.

What the Project Actually Does

The langchain-extract repository, hosted at github.com/langchain-ai/langchain-extract, is a reference application built with FastAPI, PostgreSQL, and LangChain that lets users extract structured data from unstructured documents using large language models. The core insight is simple: instead of training a custom model to extract fields from invoices, receipts, or earnings reports, you define a JSON schema of what you want and let the LLM reason through the text to produce structured output. The approach works because modern LLMs excel at understanding context, handling ambiguity, and coercing free-form text into a predefined shape.

The project supports three input formats out of the box: PDF, HTML, and plain text. Users define extractors with a JSON schema, custom instructions, and optional few-shot examples that the LLM uses for in-context learning. These extractors are persisted in PostgreSQL, can be shared among users, and work with interchangeable LLM models. The backend exposes a LangServe endpoint that lets developers plug extraction directly into their existing LangChain workflows, while the frontend allows non-technical users to define extraction schemas in natural language and test them on uploaded files.

Architecture Walkthrough: FastAPI, PostgreSQL, and LangChain in Practice

The application follows a clean three-layer architecture. The FastAPI server handles REST endpoints for creating extractors, uploading files, and running extractions. PostgreSQL stores extractor definitions, schemas, few-shot examples, and user keys. LangChain orchestrates the LLM calls, handling prompt construction, JSON schema validation, and output parsing under the hood.

The real power lies in the LangServe integration. The core extraction logic runs as a LangServe endpoint, which means it can be consumed as a RemoteRunnable from any other LangChain application. This design lets developers build complex extraction pipelines where one service extracts entities from a document, a second service validates the output, and a third service writes the results to a vector database, all chained together through LangChain's composable API.

For the LLM layer, the service supports tool calling (function calling), JSON mode, and parsing-based extraction methods. Users can swap models freely, which is critical for production deployments where cost, latency, and accuracy requirements vary by use case. The evidence field pattern, where each extracted record includes a verbatim sentence from the source document as proof, provides a built-in audit trail that downstream applications can use for verification.

Real-World Example: Extracting Financial Data from Earnings Calls

The blog post demonstrates the service on a real use case: extracting financial figures from Uber's Q4 2023 earnings call prepared remarks PDF. The schema defines fields for name, value, scale (MM, B, percent), period_start (ISO format), period_duration (months), and evidence, which captures the verbatim sentence where the figure was found. The extractor is created by posting a JSON schema definition to the service, and the same extractor can be reused across multiple documents.

This pattern generalizes to dozens of real-world applications: extracting invoice line items from supplier PDFs, pulling medical data from clinical notes, parsing legal clauses from contracts, or scraping product specifications from e-commerce pages. The evidence field is particularly valuable because it lets downstream systems verify the model's output against the original source, reducing the risk of hallucination-driven errors in production data pipelines.

Comparison to Alternatives and What It Means for Founders

The extraction space has matured significantly since this project launched. Unstructured.io offers a hosted API with partitioning and chunking for RAG pipelines, supporting over 20 file formats. LlamaParse from LlamaIndex provides document parsing specifically optimized for LLM consumption, with multimodal support for complex layouts. Azure Document Intelligence (formerly Form Recognizer) offers pre-built models for invoices, receipts, and identity documents, but requires training for custom schemas.

LangChain's approach differentiates itself in one critical dimension: flexibility. Because it relies on LLMs rather than trained classifiers, adapting it to a new document type requires only a schema change, not a model retraining cycle. This makes it ideal for early-stage products where the document types are still evolving and the training data does not exist yet. The tradeoff is that LLM-based extraction is more expensive per document than a specialized model, and accuracy can be less predictable for high-volume, homogeneous document sets.

For founders building in the data infrastructure and AI application layers, the archived status of this repo should not be read as abandonment. LangChain explicitly archived it to signal that it is a reference implementation, not a supported library. The releases tagged at 0.0.1 and 0.0.2 contain stable, documented code that can be forked, extended, and deployed. The architecture patterns (JSON schema extraction, evidence fields, LangServe composability, few-shot learning at inference time) have become standard practice across the industry. Building on this foundation rather than starting from scratch can save weeks of development time on the non-differentiating plumbing of document processing.

The core lesson for founders is this: if your product ingests any form of unstructured data, the barrier to extracting structured information from it has never been lower. You do not need labeled training data. You do not need a team of NLP engineers. You need a schema, a prompt, and an LLM. LangChain's extraction service showed that an afternoon's work can turn a stack of PDFs into queryable JSON, and that insight is more relevant today than when the repository was first published.