recallio
v1.3.0
Published
TypeScript client for Recallio API
Readme
recallio-ts
Recallio – AI-Powered Contextual Memory & Knowledge-Graph API
Store, index, and retrieve application “memories” with built-in fact extraction, dynamic summaries, reranked recall, and a full knowledge-graph layer.
🔧 Core Capabilities
Embeddings-backed Storage: Fast semantic write & recall.
LLM-Driven Insights: Fact extraction, reranking, summarization.
Full Lifecycle Management: Write, recall, delete, export.
Knowledge Graph: Entities, relationships, and powerful graph queries.
OpenAPI-First: Auto-generated Swagger docs and client libs.
TypeScript client for the Recallio API.
Installation
npm install recallioClient Setup
import { RecallioClient } from 'recallio';
const client = new RecallioClient({ apiKey: 'YOUR_API_KEY' });Memory API
Write a memory
await client.writeMemory({
userId: 'user_123',
projectId: 'project_abc',
content: { theme: 'dark', layout: 'grid' },
consentFlag: true,
});Recall memories
const memories = await client.recallMemory(
{
userId: 'user_123',
projectId: 'project_abc',
query: 'dark mode',
scope: 'user',
},
{ reRank: true }
);Summarize memories
const summary = await client.recallSummary({
userId: 'user_123',
projectId: 'project_abc',
scope: 'user',
});
console.log(summary.content);Export memories
const exported = await client.exportMemory({
type: 'fact',
format: 'json',
userId: 'user_123',
});Delete memories
await client.deleteMemory({
scope: 'user',
userId: 'user_123',
});Knowledge Graph API
Add to the graph
const added = await client.addGraphMemory({
data: 'Alice knows Bob',
user_id: 'user_123',
});Search the graph
const graphResults = await client.searchGraphMemory({
query: 'Alice',
limit: 5,
});Get relationships
const relationships = await client.getGraphRelationships({
userId: 'user_123',
limit: 50,
});Delete graph data
await client.deleteAllGraphMemory({ userId: 'user_123' });Error Handling
All API calls throw a RecallioError when the service returns an error response.
import { RecallioClient, RecallioError } from 'recallio';
try {
await client.writeMemory({
userId: 'user_123',
projectId: 'project_abc',
content: { theme: 'dark', layout: 'grid' },
consentFlag: true,
});
} catch (err) {
if (err instanceof RecallioError) {
console.error('API error', err.status, err.details);
} else {
console.error('Unexpected error', err);
}
}Knowledge API
Write knowledge
await client.writeKnowledge({
userId: 'user_123',
projectId: 'project_abc',
type: 'lead',
rawJson: { name: 'John Doe', amount: 100000 },
});Recall knowledge
const knowledge = await client.recallKnowledge({
userId: 'user_123',
projectId: 'project_abc',
query: 'highest amount',
});Ingest document
import fs from 'fs';
await client.ingestDocument({
file: fs.createReadStream('contract.pdf'),
userId: 'user_123',
projectId: 'project_abc',
consentFlag: true,
});