Postgres Chat Memory node#
ใช้ Postgres Chat Memory node เพื่อใช้ Postgres เป็น memory server สำหรับเก็บประวัติแชท
ในหน้านี้จะมีรายการ operations ที่ Postgres Chat Memory node รองรับ พร้อมลิงก์ไปยัง resource อื่นๆ ที่เกี่ยวข้อง
Credentials
คุณสามารถดูข้อมูลการเชื่อมต่อสำหรับ 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 parameters#
- Session Key: ใส่ key ที่จะใช้เก็บ memory ใน workflow data
- Table Name: ใส่ชื่อ table ที่จะใช้เก็บประวัติแชท ถ้า table ยังไม่มี ระบบจะสร้างให้
- Context Window Length: ใส่จำนวน interactions ก่อนหน้าที่จะนำมาใช้เป็น context
Related resources#
ดูข้อมูลเพิ่มเติมได้ที่ LangChain's Postgres Chat Message History documentation
ดูเอกสาร Advanced AI ของ n8n
Single memory instance#
If you add more than one Postgres Chat Memory node to your workflow, all nodes access the same memory instance by default. Be careful when doing destructive actions that override existing memory contents, such as the override all messages operation in the Chat Memory Manager node. If you want more than one memory instance in your workflow, set different session IDs in different memory nodes.
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.