Skip to main content
Glama
waldzellai

Exa Websets MCP Server

by waldzellai
Mem0Service.ts1.11 kB
import axios from 'axios'; import { log } from '../utils/logger.js'; export interface MemoryMessage { role: 'user' | 'assistant'; content: string; } export interface AddMemoryOptions { userId?: string; agentId?: string; appId?: string; metadata?: Record<string, any>; } export class Mem0Service { private apiKey: string; private baseUrl: string; constructor(apiKey: string, baseUrl = 'https://api.mem0.ai') { this.apiKey = apiKey; this.baseUrl = baseUrl; } async addMemory(messages: MemoryMessage[], options: AddMemoryOptions = {}) { const payload = { messages, ...options, version: 'v2', output_format: 'v1.1' }; try { const response = await axios.post( `${this.baseUrl}/v1/memories/`, payload, { headers: { Authorization: `Token ${this.apiKey}`, 'Content-Type': 'application/json' }, timeout: 30000 } ); return response.data; } catch (error: any) { log(`Mem0 addMemory error: ${error.message}`); throw error; } } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/waldzellai/exa-mcp-server-websets'

If you have feedback or need assistance with the MCP directory API, please join our Discord server