Getting Started
Learn how to integrate PersistQ into your AI application in under 5 minutes.
Installation
Install the PersistQ SDK for your preferred language:
npm install @persistq/sdkpip install persistqAuthentication
Get your API key from the dashboard and set it as an environment variable:
export PERSISTQ_API_KEY=pq_your_api_key_hereYour First Request
Store your first memory:
import { PersistQ } from '@persistq/sdk';
const pq = new PersistQ(process.env.PERSISTQ_API_KEY);
// Store a memory
const memory = await pq.memories.create({
content: 'User prefers dark mode and compact layouts',
group: 'preferences',
tags: ['ui', 'settings']
});
console.log('Memory stored:', memory.id);Retrieve Memories
Query memories by group or search semantically:
// Get all memories in a group
const preferences = await pq.memories.list({
group: 'preferences'
});
// Semantic search
const results = await pq.memories.search({
query: 'What are the user UI preferences?',
limit: 5
});