Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Isolated conversation contexts with automatic lifecycle management
const agent = new SynthraAgent({ apiKey: process.env.SYNTHRA_API_KEY }); // Create session const session = agent.createSession('user_abc123def456'); // Send message const response = await agent.sendMessage( session.id, 'Hello, Synthra!' ); // Delete session await agent.deleteSession(session.id);
const session = agent.createSession('user_abc123def456', { metadata: { source: 'web', language: 'en' }, contextConfig: { maxTokens: 8192, compressionEnabled: true, retentionPolicy: 'semantic' } });
try { const response = await agent.sendMessage(session.id, 'Hello!'); } catch (error) { if (error.code === 'session_not_found') { console.log('Session expired or deleted'); } }
clearSession()