Back to directory

LangExtract

A Python library that uses large language models to pull structured information out of unstructured text, mapping every extracted value back to its exact location in the source for verification.

LangExtract

LangExtract takes a user-defined extraction task, described with a prompt and a few-shot example, and applies it to documents such as clinical notes or reports, returning structured, schema-consistent output. Every extraction is grounded to its exact character location in the source text, so results can be highlighted and traced back for review; extractions the library cannot locate in the source text are flagged rather than silently kept.

For long documents, it chunks text, processes chunks in parallel, and makes multiple passes to improve recall. It generates a self-contained, interactive HTML file for reviewing thousands of extracted entities in context, and supports both cloud models such as the Gemini family and local open-source models through a built-in Ollama interface, along with custom and OpenAI-compatible model providers.

It is written in Python and licensed under Apache-2.0.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.