{"repo":"langstruct-ai/langstruct","free":true,"listed":false,"github":"https://github.com/langstruct-ai/langstruct","clone":"git clone https://github.com/langstruct-ai/langstruct.git","description":"Extract structured data from any content using LLMs.","language":"Python","stars":129,"topics":["claude","dspy","gemini","information-extraction","large-language-models","llm","nlp","openai","python","structured-data"],"license":"MIT","category":"ai-agents","readme_excerpt":"LangStruct Extract structured data from any text – automatically optimized for any LLM You know when you have a pile of invoices, medical records, or contracts, and you need to pull out specific fields or metadata? That's what this does. Point it at messy text, show it an example of what you want, and get back typed JSON. Built on DSPy so it auto-optimizes the prompts for you. You can even parse user queries into filters for your RAG system. Why use this - Auto-optimizes prompts – DSPy optimizers (MIPROv2, GEPA) do the tuning for you, learns from your examples - Type-safe with Pydantic – Full validation and type hints - End-to-end RAG – Extract structured metadata from docs AND parse user queries into filters - Shows sources – Character-level mapping back to original text - Works with any LLM – OpenAI, Claude, Gemini, or local models. Switch providers without rewriting code. - Multiple optimization strategies – Choose between MIPROv2 (fast, general) or GEPA (reflective, feedback-driven) We built this because we got tired of writing extraction code over and over. The DSPy foundation means your extractor improves with feedback, and you're not locked into one LLM provider. Installation Works with free tier APIs, paid providers, or local models (Ollama). See docs for all options. Basic usage Two ways to define what you want: Option 1: Show an example (easiest) Option 2: Use a Pydantic schema (more control) Then extract: RAG integration If you're building a RAG system, LangStruct ","default_branch":null,"files":null,"tree":[],"storefront":"/r/langstruct-ai","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/langstruct-ai/langstruct/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}