import { Memory } from "mem0ai/oss";
const config = {
llm: {
provider: "vllm",
config: {
model: "Qwen/Qwen2.5-32B-Instruct",
baseURL: "http://localhost:8000/v1",
apiKey: process.env.VLLM_API_KEY || "vllm-api-key",
temperature: 0.1,
maxTokens: 2000,
},
},
};
const memory = new Memory(config);
const messages = [
{
role: "user",
content: "I'm planning to watch a movie tonight. Any recommendations?",
},
{
role: "assistant",
content: "How about thriller movies? They can be quite engaging.",
},
{
role: "user",
content: "I'm not a big fan of thrillers, but I love sci-fi movies.",
},
{
role: "assistant",
content: "Got it! I'll avoid thrillers and suggest sci-fi movies instead.",
},
];
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });