# LangExtract v0.5.0 - Table of Contents

> Extract structured data from text using LLMs with source grounding.
Maps every extraction back to exact byte positions in the source.
Supports Claude, OpenAI, and Gemini providers. Elixir port of google/langextract.

## Pages

- [LangExtract](readme.md)
- [Alignment and Spans](alignment.md)
- [Changelog](changelog.md)

## Modules

- Core
  - [LangExtract](LangExtract.md): Extracts structured data from text with source grounding.
Maps extraction strings back to exact byte positions in source text.
  - [LangExtract.Client](LangExtract.Client.md): A configured LLM client for extraction.
  - [LangExtract.Extraction](LangExtract.Extraction.md): A single extraction: an entity class, its verbatim source text, and
arbitrary attributes.
  - [LangExtract.WireFormat](LangExtract.WireFormat.md): Port between external LLM format and internal domain.

- Prompt
  - [LangExtract.Prompt.Builder](LangExtract.Prompt.Builder.md): Renders Q&A-formatted prompts from a template for LLM extraction.

  - [LangExtract.Prompt.ExampleData](LangExtract.Prompt.ExampleData.md): A single few-shot example: a sample `text` paired with the extractions
expected from it.
  - [LangExtract.Prompt.Template](LangExtract.Prompt.Template.md): The extraction task definition: a plain-language description of what to
extract, plus few-shot examples showing the expected output.
  - [LangExtract.Prompt.Validator](LangExtract.Prompt.Validator.md): Validates that few-shot examples in a `LangExtract.Prompt.Template` are self-consistent.
  - [LangExtract.Prompt.Validator.Issue](LangExtract.Prompt.Validator.Issue.md): Describes a single alignment problem in a few-shot example.

  - [LangExtract.Prompt.Validator.ValidationError](LangExtract.Prompt.Validator.ValidationError.md): Raised by `LangExtract.Prompt.Validator.validate!/1` when alignment issues are found.

- Pipeline
  - [LangExtract.Chunker](LangExtract.Chunker.md): Splits text into sentence-level chunks using the Alignment.Tokenizer.
  - [LangExtract.Chunker.Chunk](LangExtract.Chunker.Chunk.md): A chunk of text with its byte offset in the source.

  - [LangExtract.Orchestrator](LangExtract.Orchestrator.md): Wires the full extraction pipeline.
  - [LangExtract.Pipeline](LangExtract.Pipeline.md): Extraction pipeline: normalize LLM output, parse extractions, align to source text.

  - [LangExtract.Pipeline.ChunkError](LangExtract.Pipeline.ChunkError.md): A failed chunk with its byte position in the source and error reason.

  - [LangExtract.Pipeline.Parser](LangExtract.Pipeline.Parser.md): Parses canonical extraction maps into `%Extraction{}` structs.

- Alignment
  - [LangExtract.Alignment.Aligner](LangExtract.Alignment.Aligner.md): Maps extraction strings to byte spans in source text.
  - [LangExtract.Alignment.Span](LangExtract.Alignment.Span.md): An aligned extraction with its byte position in the source text.

  - [LangExtract.Alignment.Token](LangExtract.Alignment.Token.md): A token with its byte position in the source text.
  - [LangExtract.Alignment.Tokenizer](LangExtract.Alignment.Tokenizer.md): Regex-based tokenizer that splits text into tokens with byte offsets.

- Providers
  - [LangExtract.Provider](LangExtract.Provider.md): Behaviour for LLM inference providers.
  - [LangExtract.Provider.Claude](LangExtract.Provider.Claude.md): Claude (Anthropic) provider for LLM inference.
  - [LangExtract.Provider.Gemini](LangExtract.Provider.Gemini.md): Gemini (Google) provider for LLM inference.
  - [LangExtract.Provider.OpenAI](LangExtract.Provider.OpenAI.md): OpenAI provider for LLM inference.

- Serialization
  - [LangExtract.Serializer](LangExtract.Serializer.md): Serialization and deserialization of extraction results.

