Skip to content

Pinecone Vector Store node#

ใช้ Pinecone node เพื่อโต้ตอบกับ Pinecone database ของคุณในฐานะ vector store คุณสามารถใส่ documents เข้าไปใน vector database, ดึง documents จาก vector database, เรียกดู documents เพื่อส่งต่อไปยัง retriever ที่เชื่อมต่อกับ chain หรือเชื่อมต่อโดยตรงกับ agent ในฐานะ tool

ในหน้านี้ คุณจะพบ node parameters สำหรับ Pinecone node และลิงก์ไปยังแหล่งข้อมูลเพิ่มเติม

Credentials

คุณสามารถดูข้อมูล authentication สำหรับ node นี้ได้ ที่นี่

Parameter resolution in sub-nodes (การประมวลผล Parameter ใน sub-nodes)

Sub-nodes มีพฤติกรรมแตกต่างจาก node อื่นๆ เมื่อประมวลผลหลายรายการโดยใช้ expression

Node ส่วนใหญ่ รวมถึง root node จะรับ input กี่รายการก็ได้ ประมวลผลรายการเหล่านี้ และส่ง output ออกมา คุณสามารถใช้ expression เพื่ออ้างอิงถึง input item และ node จะประมวลผล expression สำหรับแต่ละ item ตามลำดับ ตัวอย่างเช่น หากมี input เป็นค่า name ห้ารายการ expression {{ $json.name }} จะถูกประมวลผลเป็นแต่ละชื่อตามลำดับ

ใน sub-nodes expression จะถูกประมวลผลเป็น item แรกเสมอ ตัวอย่างเช่น หากมี input เป็นค่า name ห้ารายการ expression {{ $json.name }} จะถูกประมวลผลเป็นชื่อแรกเสมอ

Node usage patterns#

คุณสามารถใช้ Pinecone Vector Store node ในรูปแบบต่อไปนี้

Use as a regular node to insert, update, and retrieve documents#

คุณสามารถใช้ Pinecone Vector Store เป็น node ปกติเพื่อ insert, update หรือ get documents รูปแบบนี้จะวาง Pinecone Vector Store ไว้ใน flow การเชื่อมต่อปกติโดยไม่ต้องใช้ agent

คุณสามารถดูตัวอย่างได้ใน scenario 1 ของ template นี้

Connect directly to an AI agent as a tool#

คุณสามารถเชื่อมต่อ Pinecone Vector Store node โดยตรงกับ tool connector ของ AI agent เพื่อใช้ vector store เป็น resource เมื่อตอบคำถาม

ในกรณีนี้ การเชื่อมต่อจะเป็น: AI agent (tools connector) -> Pinecone Vector Store node

Use a retriever to fetch documents#

คุณสามารถใช้ Vector Store Retriever node ร่วมกับ Pinecone Vector Store node เพื่อดึง documents จาก Pinecone Vector Store node ซึ่งมักใช้กับ Question and Answer Chain node เพื่อดึง documents จาก vector store ที่ตรงกับ input ของ chat ที่กำหนด

ตัวอย่างของ flow การเชื่อมต่อ จะเป็น: Question and Answer Chain (Retriever connector) -> Vector Store Retriever (Vector Store connector) -> Pinecone Vector Store

Use the Vector Store Question Answer Tool to answer questions#

อีกรูปแบบหนึ่งคือการใช้ Vector Store Question Answer Tool เพื่อสรุปผลลัพธ์และตอบคำถามจาก Pinecone Vector Store node แทนที่จะเชื่อมต่อ Pinecone Vector Store โดยตรงในฐานะ tool รูปแบบนี้จะใช้ tool ที่ออกแบบมาโดยเฉพาะเพื่อสรุปข้อมูลใน vector store

flow การเชื่อมต่อ ในกรณีนี้จะมีลักษณะดังนี้: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Pinecone Vector store

Node parameters#

Operation Mode (โหมดการทำงาน)#

Vector Store node นี้มีห้าโหมด: Get Many, Insert Documents, Retrieve Documents (As Vector Store for Chain/Tool), Retrieve Documents (As Tool for AI Agent), และ Update Documents โหมดที่คุณเลือกจะกำหนดการดำเนินการที่คุณสามารถทำได้ด้วย node และ input/output ที่มีให้ใช้งาน

Get Many (ดึงข้อมูลหลายรายการ)#

ในโหมดนี้ คุณสามารถดึงเอกสารหลายรายการจาก vector database ของคุณโดยการระบุ prompt ตัว prompt จะถูกแปลงเป็น embedding และใช้สำหรับการค้นหาความคล้ายคลึง (similarity search) node จะส่งคืนเอกสารที่คล้ายกับ prompt มากที่สุดพร้อมกับคะแนนความคล้ายคลึง (similarity score) ซึ่งมีประโยชน์หากคุณต้องการดึงรายการเอกสารที่คล้ายกันและส่งต่อไปยัง agent เพื่อใช้เป็น context เพิ่มเติม

Insert Documents (แทรกเอกสาร)#

ใช้โหมด Insert Documents เพื่อแทรกเอกสารใหม่เข้าไปใน vector database ของคุณ

Retrieve Documents (As Vector Store for Chain/Tool) (ดึงเอกสาร - เป็น Vector Store สำหรับ Chain/Tool)#

ใช้โหมด Retrieve Documents (As Vector Store for Chain/Tool) กับ vector-store retriever เพื่อดึงเอกสารจาก vector database และส่งต่อไปยัง retriever ที่เชื่อมต่อกับ chain ในโหมดนี้ คุณต้องเชื่อมต่อ node เข้ากับ retriever node หรือ root node

Retrieve Documents (As Tool for AI Agent) (ดึงเอกสาร - เป็น Tool สำหรับ AI Agent)#

ใช้โหมด Retrieve Documents (As Tool for AI Agent) เพื่อใช้ vector store เป็น tool resource ในการตอบคำถาม เมื่อสร้างคำตอบ agent จะใช้ vector store เมื่อชื่อและคำอธิบายของ vector store ตรงกับรายละเอียดของคำถาม

Update Documents (อัปเดตเอกสาร)#

ใช้โหมด Update Documents เพื่ออัปเดตเอกสารใน vector database โดยใช้ ID กรอก ID ด้วย ID ของ embedding entry ที่ต้องการอัปเดต

Get Many parameters#

  • Pinecone Index: เลือกหรือป้อน Pinecone Index ที่จะใช้
  • Prompt: ป้อนคำค้นหา (search query) ของคุณ
  • Limit: ป้อนจำนวนผลลัพธ์ที่ต้องการดึงจาก vector store ตัวอย่างเช่น ตั้งค่าเป็น 10 เพื่อรับผลลัพธ์ที่ดีที่สุดสิบรายการ

Insert Documents parameters#

  • Pinecone Index: เลือกหรือป้อน Pinecone Index ที่จะใช้

Retrieve Documents (As Vector Store for Chain/Tool) parameters#

  • Pinecone Index: เลือกหรือป้อน Pinecone Index ที่จะใช้

Retrieve Documents (As Tool for AI Agent) parameters#

  • Name: ชื่อของ vector store
  • Description: อธิบายให้ LLM ทราบว่า tool นี้ทำอะไร คำอธิบายที่ดีและเฉพาะเจาะจงช่วยให้ LLM สร้างผลลัพธ์ที่คาดหวังได้บ่อยขึ้น
  • Pinecone Index: เลือกหรือป้อน Pinecone Index ที่จะใช้
  • Limit: ป้อนจำนวนผลลัพธ์ที่ต้องการดึงจาก vector store ตัวอย่างเช่น ตั้งค่าเป็น 10 เพื่อรับผลลัพธ์ที่ดีที่สุดสิบรายการ

Node options#

Pinecone Namespace#

ตัวเลือกการแบ่งแยกข้อมูลอีกวิธีหนึ่งสำหรับวิธีการจัดเก็บข้อมูลของคุณภายใน index

Metadata Filter#

Metadata Filter (ตัวกรอง Metadata)#

มีให้ใช้งานในโหมด Get Many เมื่อค้นหาข้อมูล ใช้ตัวเลือกนี้เพื่อจับคู่กับ metadata ที่เกี่ยวข้องกับเอกสาร

นี่คือการ query แบบ AND หากคุณระบุฟิลด์ตัวกรอง metadata มากกว่าหนึ่งฟิลด์ ทุกฟิลด์จะต้องตรงกันทั้งหมด

เมื่อแทรกข้อมูล metadata จะถูกตั้งค่าโดยใช้ document loader อ้างอิง Default Data Loader สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการโหลดเอกสาร

Clear Namespace#

มีให้ใช้งานในโหมด Insert Documents ลบข้อมูลทั้งหมดออกจาก namespace ก่อนที่จะใส่ข้อมูลใหม่

Templates and examples#

Ask questions about a PDF using AI

by David Roberts

View template details
Chat with PDF docs using AI (quoting sources)

by David Roberts

View template details
RAG Chatbot for Company Documents using Google Drive and Gemini

by Mihai Farcas

View template details
Browse Pinecone Vector Store integration templates, or search all templates

อ้างอิง เอกสาร Pinecone ของ LangChain สำหรับข้อมูลเพิ่มเติมเกี่ยวกับบริการ

ดูเอกสาร Advanced AI ของ n8n

Find your Pinecone index and namespace#

Pinecone index และ namespace ของคุณมีอยู่ในบัญชี Pinecone ของคุณ

Screenshot of a Pinecone account, with the Pinecone index labelled

AI glossary#

  • completion: Completions are the responses generated by a model like GPT.
  • hallucinations: Hallucination in AI is when an LLM (large language model) mistakenly perceives patterns or objects that don't exist.
  • vector database: A vector database stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.
  • vector store: A vector store, or vector database, stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.