Zep Vector Store node#
ใช้ Zep Vector Store node เพื่อโต้ตอบกับ Zep vector databases คุณสามารถใส่ documents เข้าไปใน vector database, ดึง documents จาก vector database, เรียกดู documents เพื่อส่งต่อไปยัง retriever ที่เชื่อมต่อกับ chain หรือเชื่อมต่อโดยตรงกับ agent เพื่อใช้เป็น tool
ในหน้านี้ คุณจะพบ node parameters สำหรับ Zep Vector Store node และลิงก์ไปยังแหล่งข้อมูลเพิ่มเติม
Credentials
คุณสามารถดูข้อมูล authentication สำหรับ node นี้ได้ ที่นี่
Examples and templates
สำหรับตัวอย่างการใช้งานและ templates เพื่อช่วยให้คุณเริ่มต้น โปรดดูที่หน้า Zep Vector Store integrations ของ n8n
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#
คุณสามารถใช้ Zep Vector Store node ในรูปแบบต่อไปนี้
Use as a regular node to insert, update, and retrieve documents#
คุณสามารถใช้ Zep Vector Store เป็น node ปกติเพื่อ insert หรือ get documents รูปแบบนี้จะวาง Zep Vector Store ไว้ใน flow การเชื่อมต่อปกติโดยไม่ต้องใช้ agent
คุณสามารถดูตัวอย่างได้ใน scenario 1 ของ template นี้ (ตัวอย่างใช้ Supabase แต่รูปแบบเหมือนกัน)
Connect directly to an AI agent as a tool#
คุณสามารถเชื่อมต่อ Zep Vector Store node โดยตรงกับ tool connector ของ AI agent เพื่อใช้ vector store เป็น resource เมื่อตอบคำถาม
ในกรณีนี้ การเชื่อมต่อจะเป็น: AI agent (tools connector) -> Zep Vector Store node
Use a retriever to fetch documents#
คุณสามารถใช้ Vector Store Retriever node ร่วมกับ Zep Vector Store node เพื่อดึง documents จาก Zep Vector Store node ซึ่งมักใช้กับ Question and Answer Chain node เพื่อดึง documents จาก vector store ที่ตรงกับ input ของ chat ที่กำหนด
ตัวอย่างของ flow การเชื่อมต่อ (ตัวอย่างใช้ Pinecone แต่รูปแบบเหมือนกัน) จะเป็น: Question and Answer Chain (Retriever connector) -> Vector Store Retriever (Vector Store connector) -> Zep Vector Store
Use the Vector Store Question Answer Tool to answer questions#
อีกรูปแบบหนึ่งคือการใช้ Vector Store Question Answer Tool เพื่อสรุปผลลัพธ์และตอบคำถามจาก Zep Vector Store node แทนที่จะเชื่อมต่อ Zep Vector Store โดยตรงในฐานะ tool รูปแบบนี้จะใช้ tool ที่ออกแบบมาโดยเฉพาะเพื่อสรุปข้อมูลใน vector store
flow การเชื่อมต่อ (ตัวอย่างนี้ใช้ Supabase แต่รูปแบบเหมือนกัน) ในกรณีนี้จะมีลักษณะดังนี้: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Zep 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) โหมดที่คุณเลือกจะกำหนดการดำเนินการที่คุณสามารถทำได้ด้วย 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 ตรงกับรายละเอียดของคำถาม
Insert Documents parameters#
- Collection Name: ป้อนชื่อ collection ที่จะจัดเก็บข้อมูล
Get Many parameters#
- Collection Name: ป้อนชื่อ collection ที่จะดึงข้อมูล
- Prompt: ป้อนคำค้นหา (search query)
- Limit: ป้อนจำนวนผลลัพธ์ที่ต้องการดึงจาก vector store ตัวอย่างเช่น ตั้งค่าเป็น
10
เพื่อรับผลลัพธ์ที่ดีที่สุดสิบรายการ
Retrieve Documents (As Vector Store for Chain/Tool) parameters#
- Collection Name: ป้อนชื่อ collection ที่จะดึงข้อมูล
Retrieve Documents (As Tool for AI Agent) parameters#
- Name: ชื่อของ vector store
- Description: อธิบายให้ LLM ทราบว่า tool นี้ทำอะไร คำอธิบายที่ดีและเฉพาะเจาะจงช่วยให้ LLM สร้างผลลัพธ์ที่คาดหวังได้บ่อยขึ้น
- Collection Name: ป้อนชื่อ collection ที่จะดึงข้อมูล
- Limit: ป้อนจำนวนผลลัพธ์ที่ต้องการดึงจาก vector store ตัวอย่างเช่น ตั้งค่าเป็น
10
เพื่อรับผลลัพธ์ที่ดีที่สุดสิบรายการ
Node options#
Embedding Dimensions#
ต้องเหมือนกันทั้งตอนทำ embedding ข้อมูลและตอน query ข้อมูล
สิ่งนี้กำหนดขนาดของ array ของ floats ที่ใช้แทนความหมายเชิง semantic ของเอกสารข้อความ
อ่านเพิ่มเติมเกี่ยวกับ Zep embeddings ใน เอกสาร embeddings ของ Zep
Is Auto Embedded#
มีให้ใช้งานใน Insert Documents Operation Mode เปิดใช้งานโดยค่าเริ่มต้น
ปิดใช้งานตัวเลือกนี้เพื่อกำหนดค่า embeddings ของคุณใน Zep แทนที่จะเป็นใน n8n
Metadata Filter#
Metadata Filter (ตัวกรอง Metadata)#
มีให้ใช้งานในโหมด Get Many เมื่อค้นหาข้อมูล ใช้ตัวเลือกนี้เพื่อจับคู่กับ metadata ที่เกี่ยวข้องกับเอกสาร
นี่คือการ query แบบ AND
หากคุณระบุฟิลด์ตัวกรอง metadata มากกว่าหนึ่งฟิลด์ ทุกฟิลด์จะต้องตรงกันทั้งหมด
เมื่อแทรกข้อมูล metadata จะถูกตั้งค่าโดยใช้ document loader อ้างอิง Default Data Loader สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการโหลดเอกสาร
Templates and examples#
Related resources#
อ้างอิง เอกสาร Zep ของ LangChain สำหรับข้อมูลเพิ่มเติมเกี่ยวกับบริการ
ดูเอกสาร Advanced AI ของ n8n
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.