บทเรียน 5 นาที|ไม่ต้องใช้บัตรเครดิต
เพิ่ม AI Memory ใน 5 นาที
ทำตามคู่มือทีละขั้นตอนเพื่อให้ AI ของคุณมีหน่วยความจำถาวร ทำเครื่องหมายเมื่อเสร็จแต่ละขั้นตอน
ความคืบหน้า0 / 5 ขั้นตอน
0%- สมัครสมาชิกหรือเข้าสู่ระบบบัญชี Seizn ของคุณ
- ไปที่ API Keys ในแดชบอร์ด
- คลิก 'สร้างคีย์ใหม่' แล้วคัดลอกคีย์ของคุณ
bash
npm install seizntypescript
import { Seizn } from 'seizn';
const client = new Seizn({ apiKey: process.env.SEIZN_API_KEY });
// Save a memory
const memory = await client.add({
content: "User prefers dark mode and concise responses",
memory_type: "preference",
tags: ["ui", "communication"]
});
console.log('Memory saved:', memory.id);typescript
// Search for relevant memories
const results = await client.search({
query: "What are the user's UI preferences?",
limit: 5,
threshold: 0.7
});
// Use memories in your AI prompt
for (const memory of results) {
console.log(`[${memory.similarity.toFixed(2)}] ${memory.content}`);
}คุณควรเห็นการตอบกลับแบบนี้เมื่อค้นหาหน่วยความจำ:
json
{
"success": true,
"results": [
{
"id": "mem_a1b2c3d4e5f6",
"content": "User prefers dark mode and concise responses",
"memory_type": "preference",
"tags": ["ui", "communication"],
"similarity": 0.94,
"created_at": "2026-01-15T10:30:00Z"
}
],
"count": 1,
"query_time_ms": 47
}สำเร็จ!
AI ของคุณมีหน่วยความจำถาวรแล้ว ใช้ผลการค้นหาเพื่อเพิ่มบริบทและคุณภาพการตอบกลับของ AI