
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@lanonasis/mem-intel-sdk
Advanced tools
AI-powered memory intelligence SDK with predictive recall for LanOnasis Memory-as-a-Service
The AI that anticipates what you need before you realize it.
An AI-powered memory intelligence SDK for the LanOnasis Memory-as-a-Service platform. Beyond storage and retrieval - this SDK predicts what memories you'll need based on your current context.
// The magic moment
const predictions = await client.predictiveRecall({
userId: "user-123",
context: {
currentProject: "Building dashboard components",
recentTopics: ["React", "performance"]
}
});
// "Sarah, here's what you might need"
// [92%] React Hooks Performance Optimization
// → Reason: Highly relevant to your current work
// → Action: Apply
# npm
npm install @lanonasis/mem-intel-sdk
# yarn
yarn add @lanonasis/mem-intel-sdk
# pnpm
pnpm add @lanonasis/mem-intel-sdk
For React applications:
npm install react @tanstack/react-query
For Vue applications:
npm install vue
For MCP Server:
npm install @modelcontextprotocol/sdk
import { MemoryIntelligenceClient } from "@lanonasis/mem-intel-sdk";
const client = new MemoryIntelligenceClient({
apiKey: "lano_xxxxxxxxxx", // Your Lanonasis API key
});
// Analyze memory patterns
const analysis = await client.analyzePatterns({
userId: "user-123",
timeRangeDays: 30,
});
console.log(`Total memories: ${analysis.total_memories}`);
import { NodeMemoryIntelligenceClient } from "@lanonasis/mem-intel-sdk/node";
// Automatically reads LANONASIS_API_KEY from environment
const client = NodeMemoryIntelligenceClient.fromEnv();
import {
MemoryIntelligenceProvider,
usePatternAnalysis,
} from "@lanonasis/mem-intel-sdk/react";
// Wrap your app
function App() {
return (
<MemoryIntelligenceProvider config={{ apiKey: "lano_xxx" }}>
<Dashboard />
</MemoryIntelligenceProvider>
);
}
// Use hooks in components
function Dashboard() {
const { data, isLoading } = usePatternAnalysis({
userId: "user-123",
timeRangeDays: 30,
});
if (isLoading) return <div>Loading...</div>;
return <div>Total: {data?.total_memories}</div>;
}
<script setup>
import { usePatternAnalysis } from "@lanonasis/mem-intel-sdk/vue";
const { data, loading, execute } = usePatternAnalysis();
onMounted(() => {
execute({ userId: "user-123", timeRangeDays: 30 });
});
</script>
Use behavior methods when you want the SDK to learn from successful execution patterns and suggest next actions on future tasks.
const record = await client.recordBehavior({
user_id: "user-123",
trigger: "Need to migrate endpoint auth middleware to bearer-first flow",
context: {
project: "lanonasis-cli",
current_task: "auth transport migration",
},
actions: [
{ tool: "read_file", params: { path: "src/utils/api.ts" } },
{ tool: "edit_file", params: { path: "src/utils/api.ts" } },
{ tool: "run_tests", params: { target: "api-client-auth-header.test.ts" } },
],
final_outcome: "Bearer flow migration completed and tests passed",
confidence: 0.82,
});
console.log(record.data.was_duplicate, record.data.pattern.id);
const recall = await client.recallBehavior({
user_id: "user-123",
context: {
current_task: "Add token refresh to memory command execution path",
},
limit: 5,
similarity_threshold: 0.7,
});
for (const match of recall.data.patterns) {
console.log(match.similarity_score, match.pattern.trigger);
}
const suggestion = await client.suggestAction({
user_id: "user-123",
current_state: {
task_description: "Finalize CLI release notes and dry-run publish",
completed_steps: [
{ tool: "update_changelog" },
{ tool: "bump_version" },
],
},
max_suggestions: 3,
});
console.log(suggestion.data.suggestions);
const patterns = await client.listBehaviorPatterns("user-123", {
limit: 20,
offset: 0,
});
The flagship feature that makes your memory system feel magical.
Your Current Context
│
▼
┌──────────────────────────────────────────┐
│ PREDICTION ENGINE │
│ │
│ Semantic (40%) ─┐ │
│ Temporal (30%) ─┼──► Combined Score │
│ Frequency (20%) ─┤ │
│ Serendipity (10%)┘ │
└──────────────────────────────────────────┘
│
▼
"Here's what you'll need"
const predictions = await client.predictiveRecall({
userId: "user-123",
context: {
currentProject: "Building dashboard components",
recentTopics: ["React", "TypeScript", "performance"],
activeFiles: ["/src/components/Dashboard.tsx"],
contextText: "Optimizing render performance for data tables"
},
limit: 5,
minConfidence: 50
});
// Each prediction includes:
for (const pred of predictions.data.predictions) {
console.log(`[${pred.confidence}%] ${pred.title}`);
console.log(` Why: ${pred.reason}`);
console.log(` Action: ${pred.suggestedAction}`);
console.log(` Scores: semantic=${pred.scoreBreakdown.semanticScore}, temporal=${pred.scoreBreakdown.temporalScore}`);
}
// Response includes personalized greeting
const result = await client.predictiveRecall({
userId: "user-123",
context: { currentProject: "My project" }
});
console.log(result.personalization?.greeting);
// → "Sarah, here's what you might need"
console.log(result.personalization?.tier);
// → "pro"
// When user clicks on a prediction
await client.recordPredictionFeedback({
memoryId: prediction.id,
userId: "user-123",
useful: true,
action: "clicked"
});
// → { success: true, message: "Thanks Sarah! We'll use this to improve your predictions." }
import { usePredictiveRecall, usePredictionFeedback } from "@lanonasis/mem-intel-sdk/react";
function PredictionsPanel({ userId }) {
const { data, isLoading } = usePredictiveRecall({
userId,
context: {
currentProject: "Dashboard",
recentTopics: ["React", "charts"]
}
});
const { mutate: recordFeedback } = usePredictionFeedback();
if (isLoading) return <div>Finding relevant memories...</div>;
return (
<div>
<h2>{data?.personalization?.greeting}</h2>
{data?.predictions.map(pred => (
<div key={pred.id} onClick={() => recordFeedback({
memoryId: pred.id,
userId,
useful: true,
action: "clicked"
})}>
<span className="confidence">{pred.confidence}%</span>
<h3>{pred.title}</h3>
<p>{pred.reason}</p>
</div>
))}
</div>
);
}
| Factor | Weight | Description |
|---|---|---|
| Semantic | 40% | Cosine similarity between context embedding and memory embedding |
| Temporal | 30% | Exponential decay (Ebbinghaus curve, 14-day half-life) |
| Frequency | 20% | Logarithmic scaling of access counts |
| Serendipity | 10% | Bonus for "adjacent possible" discoveries (0.3-0.6 similarity) |
This SDK is designed to complement your existing @lanonasis/mcp-core infrastructure by adding an intelligence layer on top of basic memory CRUD operations. While your core server handles memory creation, storage, and retrieval, this SDK focuses on:
Uses the latest server.registerTool() API with:
Unlike monolithic servers, this focuses solely on intelligence features, making it:
For standalone MCP server usage:
# Clone the repository
git clone https://github.com/lanonasis/memory-intelligence-engine.git
cd memory-intelligence-engine/mem-intelligence-sdk
# Install dependencies
npm install
# Build the project
npm run build
Create a .env file with your existing LanOnasis credentials:
# Required - Same as your @lanonasis/mcp-core
ONASIS_SUPABASE_URL=https://<project-ref>.supabase.co
REDACTED_SUPABASE_SERVICE_ROLE_KEY=REDACTED_SUPABASE_SERVICE_ROLE_KEY
OPENAI_API_KEY=REDACTED_OPENAI_API_KEY
# Optional
TRANSPORT=stdio # or 'http' for HTTP mode
PORT=3010 # HTTP port (default: 3010)
# Development
npm run dev
# Production
npm start
# Development
npm run dev:http
# Production
npm run start:http
memory_analyze_patternsAnalyze usage patterns and trends in your memory collection.
{
"user_id": "uuid",
"time_range_days": 30,
"response_format": "markdown"
}
Returns:
memory_suggest_tagsGet AI-powered tag suggestions for a memory.
{
"memory_id": "uuid",
"user_id": "uuid",
"max_suggestions": 5,
"include_existing_tags": true
}
Returns:
memory_find_relatedFind semantically related memories using vector similarity.
{
"memory_id": "uuid",
"user_id": "uuid",
"limit": 10,
"similarity_threshold": 0.7
}
Returns:
memory_detect_duplicatesIdentify potential duplicate or near-duplicate memories.
{
"user_id": "uuid",
"similarity_threshold": 0.9,
"max_pairs": 20
}
Returns:
memory_extract_insightsExtract key insights and patterns from your knowledge base.
{
"user_id": "uuid",
"topic": "optional focus area",
"memory_type": "project",
"max_memories": 20
}
Returns:
memory_health_checkAnalyze the organization quality of your memory collection.
{
"user_id": "uuid",
"response_format": "markdown"
}
Returns:
memory_predictive_recall (NEW in v2.0.0)AI-powered prediction of memories you'll need based on current context.
{
"user_id": "uuid",
"context": {
"current_project": "Building dashboard components",
"recent_topics": ["React", "performance"],
"context_text": "Optimizing render performance"
},
"limit": 5,
"min_confidence": 50,
"include_serendipity": true
}
Returns:
memory_prediction_feedback (NEW in v2.0.0)Record feedback on predictions to improve accuracy over time.
{
"memory_id": "uuid",
"user_id": "uuid",
"useful": true,
"action": "clicked"
}
Returns:
This server is designed to work alongside your existing infrastructure:
┌─────────────────────────┐ ┌──────────────────────────┐
│ @lanonasis/mcp-core │ │ memory-intelligence-mcp │
│ │ │ │
│ ✅ create_memory │ ←── │ 🧠 memory_analyze_patterns │
│ ✅ search_memories │ │ 🏷️ memory_suggest_tags │
│ ✅ update_memory │ ←── │ 🔗 memory_find_related │
│ ✅ delete_memory │ │ 🔍 memory_detect_duplicates│
│ ✅ list_memories │ ←── │ 💡 memory_extract_insights │
│ ✅ API key management │ │ 🏥 memory_health_check │
└─────────────────────────┘ └──────────────────────────┘
│ │
└───────────┬───────────────────────┘
▼
┌─────────────────┐
│ Supabase │
│ (Shared DB) │
└─────────────────┘
@lanonasis/mcp-corememory_suggest_tagsAdd to your claude_desktop_config.json:
{
"mcpServers": {
"lanonasis-core": {
"command": "node",
"args": ["/path/to/mcp-core/dist/index.js"],
"env": {
"ONASIS_SUPABASE_URL=https://<project-ref>.supabase.co
"ONASIS_SUPABASE_SERVICE_KEY=REDACTED_SUPABASE_SERVICE_ROLE_KEY
"OPENAI_API_KEY=REDACTED_OPENAI_API_KEY
}
},
"memory-intelligence": {
"command": "node",
"args": ["/path/to/memory-intelligence-mcp-server/dist/index.js"],
"env": {
"ONASIS_SUPABASE_URL=https://<project-ref>.supabase.co
"ONASIS_SUPABASE_SERVICE_KEY=REDACTED_SUPABASE_SERVICE_ROLE_KEY
"OPENAI_API_KEY=REDACTED_OPENAI_API_KEY
}
}
}
}
npx @modelcontextprotocol/inspector dist/index.js
All tools support both markdown (human-readable) and json (machine-readable) formats:
// Request with JSON format
{
"user_id": "...",
"response_format": "json"
}
// Returns structured data
{
"content": [{ "type": "text", "text": "{...}" }],
"structuredContent": { /* typed object */ }
}
Tools return actionable error messages:
{
"isError": true,
"content": [
{
"type": "text",
"text": "Error analyzing patterns: Database connection failed. Try checking your ONASIS_SUPABASE_URL=https://<project-ref>.supabase.co
}
]
}
Your Supabase database must have:
memory_entries table with embedding column (vector)match_memories RPC function for vector similarity search| Aspect | Monolithic | Intelligence Server |
|---|---|---|
| Deployment | Single point of failure | Independent scaling |
| Updates | Risk to core functionality | Safe to iterate |
| Resource Usage | Shared memory/CPU | Dedicated resources |
| Testing | Complex integration tests | Focused unit tests |
| Reusability | Tied to LanOnasis | Portable to other projects |
# Build and verify the package
npm run publish:dry-run
# Publish to npm (requires npm login)
npm run publish:npm
To publish to GitHub Packages, update .npmrc:
@lanonasis:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
Then publish:
npm publish --access public
Contributions are welcome! Please feel free to submit a Pull Request.
For predictive recall features, run the migration:
# Option 1: Supabase CLI
supabase db push
# Option 2: Copy SQL to Supabase SQL Editor
# File: supabase/migrations/20260113_prediction_system.sql
This creates:
prediction_feedback - Track prediction accuracyprediction_history - Audit logincrement_access_count() - Frequency scoringget_user_profile_for_predictions() - Personalizationhas_premium_feature() - Premium tier gatingget_prediction_accuracy() - Metrics-- Enable predictive recall for a user
UPDATE profiles
SET subscription_tier = 'pro',
feature_flags = '{"predictive_recall": true}'::jsonb
WHERE id = 'user-uuid';
MIT License - See LICENSE for details.
Built with care by the LanOnasis team.
We believe AI should anticipate your needs, not just respond to commands.
FAQs
AI-powered memory intelligence SDK with predictive recall for LanOnasis Memory-as-a-Service
We found that @lanonasis/mem-intel-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.