You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/langchain_community
Noah Stapp e135e5257c
community[patch]: Include scores in MongoDB Atlas QA chain results (#14666)
Adds the ability to return similarity scores when using
`RetrievalQA.from_chain_type` with `MongoDBAtlasVectorSearch`. Requires
that `return_source_documents=True` is set.

Example use:

```
vector_search = MongoDBAtlasVectorSearch.from_documents(...)

qa = RetrievalQA.from_chain_type(
	llm=OpenAI(), 
	chain_type="stuff", 
	retriever=vector_search.as_retriever(search_kwargs={"additional": ["similarity_score"]}),
	return_source_documents=True
)

...

docs = qa({"query": "..."})

docs["source_documents"][0].metadata["score"] # score will be here
```

I've tested this feature locally, using a MongoDB Atlas Cluster with a
vector search index.
7 months ago
..
adapters community[patch]: Add safe lookup to OpenAI response adapter (#14765) 8 months ago
agent_toolkits core[patch], community[patch], langchain[patch], docs: Update SQL chains/agents/docs (#16168) 7 months ago
callbacks community[minor]: Improve mlflow callback (#15691) 7 months ago
chat_loaders Do not issue beta or deprecation warnings on internal calls (#15641) 8 months ago
chat_message_histories communty[minor]: Store Message History to TiDB Database (#16304) 7 months ago
chat_models feat: adding paygo api support for Azure ML / Azure AI Studio (#14560) 7 months ago
docstore community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
document_loaders community[minor]: New documents loader for visio files (with extension .vsdx) (#16171) 7 months ago
document_transformers community[minor]: Adding asynchronous function implementation for Doctran (#15941) 7 months ago
embeddings community: normalize bedrock embeddings (#15103) 7 months ago
graphs Fix neo4j sanitize (#16439) 7 months ago
indexes community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
llms feat: adding paygo api support for Azure ML / Azure AI Studio (#14560) 7 months ago
output_parsers langchain[patch], community[minor]: move `output_parsers.ernie_functions` (#16057) 7 months ago
retrievers community[patch]: Handle when documents are not provided in the Cohere response (#16144) 7 months ago
storage community: SQLStrStore/SQLDocStore provide an easy SQL alternative to `InMemoryStore` to persist data remotely in a SQL storage (#15909) 7 months ago
tools community[patch]: Update bing results tool name (#16395) 7 months ago
utilities core[patch], community[patch], langchain[patch], docs: Update SQL chains/agents/docs (#16168) 7 months ago
utils openai[minor]: implement langchain-openai package (#15503) 8 months ago
vectorstores community[patch]: Include scores in MongoDB Atlas QA chain results (#14666) 7 months ago
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
cache.py Do not issue beta or deprecation warnings on internal calls (#15641) 8 months ago
py.typed community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago