mrkeyoor.com_
Fri 25 Sept 15:55 UTC
AI Toolsevaluationupdated 25 Sept 2026

langextract review

LangExtract is a Python library that asks a language model to turn unstructured text into named fields, then maps each extracted phrase back to its location in the source. It is built for work where a person needs to inspect the evidence behind an LLM-produced record instead of accepting a free-form answer.

Verdict

Our LangExtract run installed 128 packages and passed 877 of 880 tests, but 3 provider-plugin packaging tests failed and pip-audit found 3 known vulnerabilities. Use it when source-linked extraction and human review matter more than a bare JSON response from a model. Pin the dependency set, test your chosen provider path, and keep a reviewer in the loop for consequential documents.

We ran it

Lab card: what happened when we ran langextractScreenshot of langextract (pypi.org/project/langextract)
Install✓ · 25s128 packages · 290 MB
Build✓ · 1s
Tests✗ · 82s877 passed · 3 failed · 20 skipped of 880 (pytest)
Known vulns3(pip-audit)
Repo150 files~41,621 lines of source · 13.1 MB · 11 CI workflows · Dockerfile · tests dir

Answers from our run

Does langextract build from source?

Dependencies installed in 25 seconds (128 packages), and the build succeeded in 1 seconds. We cloned commit 62b933a into a clean Debian container with 3 CPUs and no project-specific setup.

Do langextract's tests pass?

Not all of them: 877 of 880 passed and 3 failed when we ran the project's own test command (pytest). Some failures need services or credentials a bare container does not have.

Does langextract have known vulnerabilities in its dependencies?

pip-audit flagged 3 known advisories in the dependency tree at the time of our run.

Who should not use langextract?

Pipelines that cannot tolerate model inference or require every field to be correct without review: the README says ungrounded extractions can occur and gives them a null character interval.

What are the alternatives to langextract?

Instructor, Presidio, Unstructured. Our LangExtract run installed 128 packages and passed 877 of 880 tests, but 3 provider-plugin packaging tests failed and pip-audit found 3 known vulnerabilities.

Setup3/525-second install; provider keys or local Ollama still required
Docs5/5Clear examples for grounding, schemas, providers, and long text
Community5/538,841 stars with issue and pull-request activity in September
Maturity3/5877 tests passed, but packaging failures and 3 advisories remain

Who it’s for

Python teams extracting entities, attributes, or relationships from long documents.
Researchers who need source spans and an HTML view for checking model output.
Developers using Gemini, OpenAI, Vertex AI, Ollama, or a custom provider plugin.
Domain experts who can supply careful instructions and representative few-shot examples.

Who it’s NOT for

Pipelines that cannot tolerate model inference or require every field to be correct without review: the README says ungrounded extractions can occur and gives them a null character interval.
Local Ollama users who require a custom output schema: the README says Ollama's provider does not currently support output_schema.
Teams expecting one provider configuration to behave identically across paths: open issues report an ignored temperature with config= or model= and a misplaced tools field in Vertex batch requests.
Developers depending on the provider-plugin generator today: all 3 failures in our 880-test run came from editable-install or package-generation cases.
Regulated health products seeking an approved clinical system: the medical examples are explicitly demonstrations, and Google says this is not an officially supported product.

Setup reality

Our sandbox installed 128 packages in 25 seconds, using 290 MB on disk. The build succeeded in 1 second. Tests failed after 82 seconds: pytest reported 877 passed, 3 failed, and 20 skipped out of 880, plus 52 passing subtests.

Cloud use needs a Gemini or OpenAI key, or Vertex AI project and service-account configuration. Local inference needs Ollama plus a downloaded model. Prompts, examples, provider choice, chunk size, and output handling remain application work.

All 3 failed tests concerned provider-plugin installation or packaging, including an editable install that had to work offline. Pip-audit found 3 known vulnerabilities. The repository has a Dockerfile, 11 CI workflows, and a tests directory, but our checked-out commit did not produce a clean test or audit result.

Source spans make model output inspectable

LangExtract's useful move is to keep extracted text tied to the document it came from. You define classes, attributes, instructions, and examples; a model produces structured items; the resolver finds the matching character intervals in the source. A reviewer can then see each claim in context. When an item cannot be located, its character interval is null, giving application code a reason to reject or quarantine it.

That is different from assuming the model's JSON is true. The README warns that examples should use verbatim text in source order and can trigger alignment warnings when they do not. It also says a model may copy material from the few-shot examples into its answer. Filtering null intervals catches output that cannot be grounded, but a phrase can exist in the document and still be labeled incorrectly. The final check remains a domain decision.

Long documents are split, repeated, and reviewed

For a long input, LangExtract divides text into chunks, sends work in parallel, and can make multiple extraction passes. The README's sample sets extraction_passes=3, max_workers=20, and a 1,000-character buffer. Those are controls, not a promised speed or accuracy result. More passes and smaller chunks change request count, cost, context, and the chance that a relationship crosses a boundary.

Results can be saved as JSONL and rendered as a self-contained interactive HTML file. Highlighted spans let a human move between the structured item and its source sentence. That review surface is one reason to choose LangExtract over a small script that asks for JSON. Missing spans, repeated mentions, and inferred attributes become visible.

What happened when we ran it

Our sandbox installed 128 Python packages in 25 seconds and occupied 290 MB on disk. The package build succeeded in 1 second. We tested commit 62b933a in an unprivileged Python 3.12 Bookworm container with 3 CPUs and 8 GB of RAM. The checkout contained 150 files, about 41,621 lines of source, and used 13.1 MB before dependencies.

Pytest exited with code 1 after 82 seconds. It reported 877 passed, 3 failed, and 20 skipped out of 880 tests, alongside 52 passing subtests and 94 warnings. Each failure came from create_provider_plugin_test.py: one expected an offline-safe editable install to succeed with pip, while 2 expected generated wheel, source distribution, or PEP 660 installation checks to return successfully. The supplied log tail does not show the underlying stdout, so we cannot assign a cause.

Pip-audit reported 3 known vulnerabilities in the installed environment. Our measurement does not identify them in the supplied block, so this review will not guess which packages or advisories were involved. The repository also had 11 CI workflows, a Dockerfile, and a tests directory. Those are good maintenance signals, but they do not turn this particular failing run into a pass.

Provider choice changes more than the API key

Gemini is the default path in the current quick start. OpenAI support needs the optional extra, while Vertex AI accepts a project, location, service-account authentication, and an optional batch configuration. Ollama provides a local route with no cloud key, but the README says its provider does not support output_schema. A custom provider can be shipped as a separate package and discovered through an entry point.

Those paths do not have identical behavior. Issue 529 reports that top-level temperature=0.0 is silently omitted when callers pass a prebuilt config or model, even though it reaches the provider with model_id. Issue 532 reports that Vertex batch mode places tools inside generationConfig, where the batch schema rejects it. Both reports include isolated reproductions. Test the exact provider, real-time or batch path, and configuration style you plan to deploy.

Schema controls still need examples and rejection rules

Gemini and OpenAI can use an explicit output schema, with or without few-shot examples. Supported models can also use controlled generation. That narrows the response shape, but it does not decide which facts belong in a field. A good extraction job still needs examples that cover ambiguous mentions, absent values, repeated names, and attributes that must remain tied to literal evidence.

Issue 542 gives a narrower warning about configuration compatibility. Passing format_type through the older resolver_params route can leave a string where the formatter expects an enum, leading to an AttributeError before inference. A pull request was open when we checked. Pin LangExtract, validate the configuration at startup, and keep document fixtures that must produce expected spans.

Release 1.7.0 is active, while the queue is busy

Version 1.7.0 was published on September 13, 2026. Its notes cover repeated-mention alignment, provider-plugin generation, Gemini settings, unusable provider responses, and OpenAI routing. The main branch advanced to commit 62b933a on September 21, and GitHub showed 123 combined open issues and pull requests plus 38,841 stars. Activity continued in the queue through September 24.

Google labels the project as unofficially supported, despite the organization name. Health-related examples carry an additional terms notice and say they are demonstrations rather than approved products. Source grounding makes review easier; it does not certify an extraction for diagnosis, treatment, compliance, or any other decision where a wrong field can harm someone.

Choose it when evidence must travel with the field

Instructor is a closer fit when typed responses and retries are enough. Presidio is narrower and more predictable for PII detection and redaction. Unstructured belongs earlier in the pipeline when document parsing and layout are the obstacle. LangExtract earns the extra machinery when the extracted record must point back into its source and a person will inspect that link.

The 877 passing tests show substantial exercised code, while the 3 packaging failures and 3 audit findings set the terms for adoption. Start with one provider and a representative document set. Reject null spans, record the model and prompt configuration, and read the HTML output before feeding extracted fields into another system. That workflow uses LangExtract's strongest feature without mistaking traceability for correctness.

Alternatives

ProjectWhat it isPick it when
InstructorAdds typed structured outputs and validation to several model clients.pick this instead when your main goal is validated model responses rather than mapping extracted phrases back to document spans.
PresidioDetects and anonymizes sensitive information with analyzers you can inspect and extend.pick this instead when PII detection and redaction are the job and you want a purpose-built system rather than prompt-defined extraction.
UnstructuredPartitions many document formats into elements for downstream search and AI pipelines.pick this instead when parsing PDFs, office files, and layout is the hard part before extraction begins.

What people are saying

  1. [github-trending] google/langextract

Sources

  1. LangExtract README
  2. LangExtract v1.7.0 release
  3. Format type crash issue
  4. Ignored temperature issue
  5. Vertex batch tools issue
  6. Measured main commit

More ai tools reviews

nobodywho · desktop-cc-gui · openrig · skills · awesome-grokbot · monty · the whole board →