mirror of
https://github.com/hwchase17/langchain.git
synced 2025-12-15 20:04:15 +00:00
docs[patch]: Update docs links (#23013)
This commit is contained in:
@@ -907,8 +907,8 @@ Second, consider the data sources available to your RAG system. You want to quer
|
|||||||
|
|
||||||
| Name | When to use | Description |
|
| Name | When to use | Description |
|
||||||
|------------------|--------------------------------------------|-------------|
|
|------------------|--------------------------------------------|-------------|
|
||||||
| [Logical routing](/docs/how_to/routing/#using-a-runnablebranch) | When you can prompt an LLM with rules to decide where to route the input. | Logical routing can use an LLM to reason about the query and choose which datastore is most appropriate. |
|
| [Logical routing](/docs/how_to/routing/) | When you can prompt an LLM with rules to decide where to route the input. | Logical routing can use an LLM to reason about the query and choose which datastore is most appropriate. |
|
||||||
| [Semantic routing](/docs/how_to/routing/#using-a-runnablebranch) | When semantic similarity is an effective way to determine where to route the input. | Semantic routing embeds both query and, typically a set of prompts. It then chooses the appropriate prompt based upon similarity. |
|
| [Semantic routing](/docs/how_to/routing/#routing-by-semantic-similarity) | When semantic similarity is an effective way to determine where to route the input. | Semantic routing embeds both query and, typically a set of prompts. It then chooses the appropriate prompt based upon similarity. |
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
@@ -961,7 +961,7 @@ Fifth, consider ways to improve the quality of your similarity search itself. Em
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
There are some additional tricks to improve the quality of your retrieval. Embeddings excel at capturing semantic information, but may struggle with keyword-based queries. Many [vector stores](https://python.langchain.com/v0.2/docs/integrations/retrievers/pinecone_hybrid_search/) offer built-in [hybrid-search](https://docs.pinecone.io/guides/data/understanding-hybrid-search) to combine keyword and semantic similarity, which marries the benefits of both approaches. Furthermore, many vector stores have [maximal marginal relevance](https://python.langchain.com/v0.1/docs/modules/model_io/prompts/example_selectors/mmr/), which attempts to diversify the results of a search to avoid returning similar and redundant documents.
|
There are some additional tricks to improve the quality of your retrieval. Embeddings excel at capturing semantic information, but may struggle with keyword-based queries. Many [vector stores](/docs/integrations/retrievers/pinecone_hybrid_search/) offer built-in [hybrid-search](https://docs.pinecone.io/guides/data/understanding-hybrid-search) to combine keyword and semantic similarity, which marries the benefits of both approaches. Furthermore, many vector stores have [maximal marginal relevance](https://python.langchain.com/v0.1/docs/modules/model_io/prompts/example_selectors/mmr/), which attempts to diversify the results of a search to avoid returning similar and redundant documents.
|
||||||
|
|
||||||
| Name | When to use | Description |
|
| Name | When to use | Description |
|
||||||
|-------------------|----------------------------------------------------------|-------------|
|
|-------------------|----------------------------------------------------------|-------------|
|
||||||
|
|||||||
@@ -323,7 +323,7 @@
|
|||||||
"id": "fa0f589d",
|
"id": "fa0f589d",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Routing by semantic similarity\n",
|
"## Routing by semantic similarity\n",
|
||||||
"\n",
|
"\n",
|
||||||
"One especially useful technique is to use embeddings to route a query to the most relevant prompt. Here's an example."
|
"One especially useful technique is to use embeddings to route a query to the most relevant prompt. Here's an example."
|
||||||
]
|
]
|
||||||
@@ -371,7 +371,7 @@
|
|||||||
"chain = (\n",
|
"chain = (\n",
|
||||||
" {\"query\": RunnablePassthrough()}\n",
|
" {\"query\": RunnablePassthrough()}\n",
|
||||||
" | RunnableLambda(prompt_router)\n",
|
" | RunnableLambda(prompt_router)\n",
|
||||||
" | ChatAnthropic(model_name=\"claude-3-haiku-20240307\")\n",
|
" | ChatAnthropic(model=\"claude-3-haiku-20240307\")\n",
|
||||||
" | StrOutputParser()\n",
|
" | StrOutputParser()\n",
|
||||||
")"
|
")"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user