New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

vasperamemory-sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vasperamemory-sdk

VasperaMemory TypeScript/JavaScript SDK - Universal AI memory layer

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

VasperaMemory TypeScript SDK

Add persistent AI memory to your applications. Your AI agents remember context across sessions.

npm version License: MIT

Why VasperaMemory?

  • Persistent Memory — Your AI remembers decisions, patterns, and fixes across sessions
  • Error Fix Memory — Save error fixes once, get suggestions automatically next time
  • Change Impact Analysis — Understand what code changes will affect before making them
  • Entity Intelligence — Track relationships between code entities across your codebase
  • Pattern Library — Access and contribute to community-shared coding patterns
  • Framework Ready — Works with Vercel AI SDK, LangChain, and more

Installation

npm install vasperamemory-sdk

Quick Start

import { VasperaMemory } from 'vasperamemory-sdk';

const vm = new VasperaMemory({
  apiKey: process.env.VASPERAMEMORY_API_KEY,
  projectId: process.env.VASPERAMEMORY_PROJECT_ID
});

// Search your project's memory
const results = await vm.search('authentication patterns');

// Capture decisions for future reference
await vm.captureDecision({
  category: 'architectural',
  title: 'Use Redis for caching',
  content: 'Chose Redis for its data structure support'
});

// Find past fixes for errors
const fix = await vm.findErrorFix('TypeError: Cannot read property');

New in v0.2.0

Change Impact Analysis

Understand what will be affected before making code changes:

// Analyze impact before modifying code
const impact = await vm.analyzeChangeImpact(
  'src/auth/handler.ts',
  ['validateToken', 'refreshSession']
);
console.log('Affected files:', impact.affectedFiles);
console.log('Risk level:', impact.riskLevel);

// Estimate risk for a set of changes
const risk = await vm.estimateChangeRisk(
  ['src/auth/handler.ts', 'src/middleware/auth.ts'],
  'refactor'
);
console.log('Risk score:', risk.riskScore);
console.log('Recommendations:', risk.recommendations);

// Find similar code implementations
const similar = await vm.findSimilarCode(`
  async function validateToken(token: string) {
    const decoded = jwt.verify(token, secret);
    return decoded;
  }
`);

Entity Intelligence

Track and query code entities across your codebase:

// Search for entities
const entities = await vm.searchEntities('auth', {
  entityType: 'function',
  limit: 10
});

// Get relationships between entities
const relationships = await vm.getEntityRelationships('UserService', {
  direction: 'both',
  predicateFilter: 'uses'
});

// Track entity evolution over time
const evolution = await vm.getEntityEvolution('src/services/auth.ts', 'validateUser');
console.log('Stability score:', evolution.stabilityScore);
console.log('Version count:', evolution.versionCount);

Export & Import

Migrate or backup your project memory:

// Export memories
const exportResult = await vm.exportMemory({
  format: 'json',
  includeDecisions: true,
  includeErrors: true
});
console.log('Download URL:', exportResult.downloadUrl);

// Import memories
const importResult = await vm.importMemory(memoryData, 'append');
console.log('Imported:', importResult.importedCount);

Pattern Library

Access community patterns and share your own:

// Get pattern suggestions based on context
const suggestions = await vm.suggestPatterns({
  context: 'implementing authentication middleware',
  filePath: 'src/middleware/auth.ts'
});

// Search community patterns
const patterns = await vm.searchPatterns('error handling', {
  category: 'typescript'
});

// Contribute a pattern
await vm.contributePattern(
  'Repository Pattern',
  'Abstract data access layer for database operations',
  'architecture',
  `class UserRepository {
    async findById(id: string): Promise<User> { ... }
  }`
);

Vercel AI SDK Integration

import { createVasperaMemoryTools } from 'vasperamemory-sdk/vercel-ai';
import { generateText } from 'ai';

const tools = createVasperaMemoryTools(vm);

const result = await generateText({
  model: openai('gpt-4'),
  prompt: 'What patterns do we use?',
  tools
});

API Reference

Core Methods

MethodDescription
search(query, options?)Search memories by semantic similarity
captureMemory(request)Save a new memory
captureDecision(request)Record an architectural decision
captureErrorFix(request)Save an error fix for future reference
findErrorFix(errorMessage)Find a fix for a known error
getSessionContext(options?)Get comprehensive session context
fuseContext(options?)Merge context from multiple sources

Change Analysis Methods (v0.2.0)

MethodDescription
analyzeChangeImpact(file, symbols)Analyze impact of modifying code
predictChangeImpact(file, options?)Predict ripple effects of changes
estimateChangeRisk(files, changeType?)Assess risk before making changes
findSimilarCode(code, options?)Find similar implementations

Entity Methods (v0.2.0)

MethodDescription
searchEntities(query, options?)Search code entities
getEntityRelationships(entity, options?)Get entity dependencies
getEntityEvolution(file, entity?)Track entity history

Export/Import Methods (v0.2.0)

MethodDescription
exportMemory(options?)Export to JSON/markdown/YAML
importMemory(data, strategy?)Import from external sources

Pattern Methods (v0.2.0)

MethodDescription
suggestPatterns(options?)Get context-aware pattern suggestions
searchPatterns(query, options?)Search community patterns
contributePattern(name, desc, category, example?)Share a pattern

Get Your API Key

  • Run npx vasperamemory connect in any project
  • Enter your email when prompted
  • Your API key is generated automatically

Or sign up at vasperamemory.com

Documentation

Full API documentation: vasperamemory.com/docs/sdk

License

MIT — Use it, modify it, ship it.

Keywords

ai

FAQs

Package last updated on 15 Jan 2026

Related posts