!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())

[Skip to main content](#__docusaurus_skipToContent_fallback)

LangChain v0.2 is coming soon! Preview the new docs [here](/v0.2/docs/introduction/).

[

![🦜️🔗 Langchain](/v0.1/img/brand/wordmark.png)![🦜️🔗 Langchain](/v0.1/img/brand/wordmark-dark.png)

](/v0.1/)[Docs](/v0.1/docs/get_started/introduction/)[Use cases](/v0.1/docs/use_cases/)[Integrations](/v0.1/docs/integrations/platforms/)[API Reference](https://api.js.langchain.com)

[More](#)

*   [People](/v0.1/docs/people/)
*   [Community](/v0.1/docs/community/)
*   [Tutorials](/v0.1/docs/additional_resources/tutorials/)
*   [Contributing](/v0.1/docs/contributing/)

[v0.1](#)

*   [v0.2](https://js.langchain.com/v0.2/docs/introduction)
*   [v0.1](/v0.1/docs/get_started/introduction/)

[🦜🔗](#)

*   [LangSmith](https://smith.langchain.com)
*   [LangSmith Docs](https://docs.smith.langchain.com)
*   [LangChain Hub](https://smith.langchain.com/hub)
*   [LangServe](https://github.com/langchain-ai/langserve)
*   [Python Docs](https://python.langchain.com/)

[Chat](https://chatjs.langchain.com)[](https://github.com/langchain-ai/langchainjs)

Search

*   [Use cases](/v0.1/docs/use_cases/)
    
    *   [SQL](/v0.1/docs/use_cases/sql/)
        
    *   [Chatbots](/v0.1/docs/use_cases/chatbots/)
        
    *   [Extraction](/v0.1/docs/use_cases/extraction/)
        
        *   [Quickstart](/v0.1/docs/use_cases/extraction/quickstart/)
        *   [How-To Guides](/v0.1/docs/use_cases/extraction/how_to/examples/)
            
        *   [Guidelines](/v0.1/docs/use_cases/extraction/guidelines/)
    *   [Query Analysis](/v0.1/docs/use_cases/query_analysis/)
        
    *   [Q&A with RAG](/v0.1/docs/use_cases/question_answering/)
        
    *   [Tool use](/v0.1/docs/use_cases/tool_use/)
        
    *   [Interacting with APIs](/v0.1/docs/use_cases/api/)
    *   [Tabular Question Answering](/v0.1/docs/use_cases/tabular/)
    *   [Graphs](/v0.1/docs/use_cases/graph/)
        
    *   [Summarization](/v0.1/docs/use_cases/summarization/)
    *   [Agent Simulations](/v0.1/docs/use_cases/agent_simulations/)
        
    *   [Autonomous Agents](/v0.1/docs/use_cases/autonomous_agents/)
        
    *   [Code Understanding](/v0.1/docs/use_cases/code_understanding/)
    *   [Audio/Video Structured Extraction](/v0.1/docs/use_cases/media/)

*   [](/v0.1/)
*   [Use cases](/v0.1/docs/use_cases/)
*   [Extraction](/v0.1/docs/use_cases/extraction/)
*   Guidelines

On this page

Guidelines
==========

The quality of extraction results depends on many factors.

Here is a set of guidelines to help you squeeze out the best performance from your models:

*   Set the model temperature to `0`.
*   Improve the prompt. The prompt should be precise and to the point.
*   Document the schema: Make sure the schema is documented to provide more information to the LLM.
*   Provide reference examples! Diverse examples can help, including examples where nothing should be extracted.
*   If you have a lot of examples, use a retriever to retrieve the most relevant examples.
*   Benchmark with the best available LLM/Chat Model (e.g., claude-3, gpt-4, etc) – check with the model provider which one is the latest and greatest!
*   If the schema is very large, try breaking it into multiple smaller schemas, run separate extractions and merge the results.
*   Make sure that the schema allows the model to REJECT extracting information. If it doesn’t, the model will be forced to make up information!
*   Add verification/correction steps (ask an LLM to correct or verify the results of the extraction).

Benchmark[​](#benchmark "Direct link to Benchmark")
---------------------------------------------------

*   Create and benchmark data for your use case using [LangSmith 🦜️🛠️](https://docs.smith.langchain.com/).
*   Is your LLM good enough? Use [langchain-benchmarks 🦜💯](https://github.com/langchain-ai/langchain-benchmarks) to test out your LLM using existing datasets.

Keep in mind! 😶‍🌫️[​](#keep-in-mind "Direct link to Keep in mind! 😶‍🌫️")
----------------------------------------------------------------------------

*   LLMs are great, but are not required for all cases! If you’re extracting information from a single structured source (e.g., linkedin), using an LLM is not a good idea – traditional web-scraping will be much cheaper and reliable.
    
*   **human in the loop** If you need **perfect quality**, you’ll likely need to plan on having a human in the loop – even the best LLMs will make mistakes when dealing with complex extraction tasks.
    

* * *

#### Help us out by providing feedback on this documentation page:

[

Previous

Without function calling

](/v0.1/docs/use_cases/extraction/how_to/parse/)[

Next

Query analysis

](/v0.1/docs/use_cases/query_analysis/)

*   [Benchmark](#benchmark)
*   [Keep in mind! 😶‍🌫️](#keep-in-mind)

Community

*   [Discord](https://discord.gg/cU2adEyC7w)
*   [Twitter](https://twitter.com/LangChainAI)

GitHub

*   [Python](https://github.com/langchain-ai/langchain)
*   [JS/TS](https://github.com/langchain-ai/langchainjs)

More

*   [Homepage](https://langchain.com)
*   [Blog](https://blog.langchain.dev)

Copyright © 2024 LangChain, Inc.