Skip to content

The agent engineering platform.

Reduce number of documents to return for Pinecone (#2299)

Kenneth Leung00d3ec5ed834
diff --git a/langchain/vectorstores/pinecone.py b/langchain/vectorstores/pinecone.py
index 7983ba456d..b5479acf30 100644
--- a/langchain/vectorstores/pinecone.py
+++ b/langchain/vectorstores/pinecone.py
@@ -90,7 +90,7 @@ class Pinecone(VectorStore):
def similarity_search_with_score(
self,
query: str,
- k: int = 5,
+ k: int = 4,
filter: Optional[dict] = None,
namespace: Optional[str] = None,
) -> List[Tuple[Document, float]]:
@@ -125,7 +125,7 @@ class Pinecone(VectorStore):
def similarity_search(
self,
query: str,
- k: int = 5,
+ k: int = 4,
filter: Optional[dict] = None,
namespace: Optional[str] = None,
**kwargs: Any,