npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lanonasis/mem-intel-sdk

v1.1.0

Published

AI-powered memory intelligence SDK for LanOnasis Memory-as-a-Service

Readme

Memory Intelligence SDK 🧠✨

npm version License: MIT

An AI-powered memory intelligence SDK for the LanOnasis Memory-as-a-Service platform. Provides advanced analytics, insights, and intelligent organization features.

Features

  • Pattern Recognition - Understand usage trends and productivity patterns
  • Smart Organization - AI-powered tag suggestions and duplicate detection
  • Semantic Intelligence - Find related memories using vector similarity
  • Actionable Insights - Extract key learnings and opportunities from your knowledge base
  • Health Monitoring - Ensure your memory database stays organized and healthy

Platform Support

  • Node.js - Full support with environment variable configuration
  • Browser - Universal client for web applications
  • React - Hooks with React Query integration
  • Vue 3 - Composables for Vue applications
  • MCP Server - Create Model Context Protocol servers

Installation

# npm
npm install @lanonasis/mem-intel-sdk

# yarn
yarn add @lanonasis/mem-intel-sdk

# pnpm
pnpm add @lanonasis/mem-intel-sdk

Framework-specific peer dependencies

For React applications:

npm install react @tanstack/react-query

For Vue applications:

npm install vue

For MCP Server:

npm install @modelcontextprotocol/sdk

Quick Start

Basic Usage

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}`);

Node.js with Environment Variables

import { NodeMemoryIntelligenceClient } from "@lanonasis/mem-intel-sdk/node";

// Automatically reads LANONASIS_API_KEY from environment
const client = NodeMemoryIntelligenceClient.fromEnv();

React Integration

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>;
}

Vue Integration

<script setup>
import { usePatternAnalysis } from "@lanonasis/mem-intel-sdk/vue";

const { data, loading, execute } = usePatternAnalysis();

onMounted(() => {
  execute({ userId: "user-123", timeRangeDays: 30 });
});
</script>

Overview

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:

  • Pattern Recognition - Understand usage trends and productivity patterns
  • Smart Organization - AI-powered tag suggestions and duplicate detection
  • Semantic Intelligence - Find related memories using vector similarity
  • Actionable Insights - Extract key learnings and opportunities from your knowledge base
  • Health Monitoring - Ensure your memory database stays organized and healthy

Why This SDK?

Modern MCP Patterns

Uses the latest server.registerTool() API with:

  • Zod schema validation
  • Structured content output
  • Proper tool annotations
  • Both JSON and Markdown response formats

Single Responsibility

Unlike monolithic servers, this focuses solely on intelligence features, making it:

  • Easier to maintain
  • More composable
  • Better suited for specific use cases

Production-Ready

  • Streamable HTTP transport support
  • Proper error handling with actionable messages
  • Character limit enforcement
  • Comprehensive logging

MCP Server Setup

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

Configuration

Create a .env file with your existing LanOnasis credentials:

# Required - Same as your @lanonasis/mcp-core
ONASIS_SUPABASE_URL=your_supabase_url
ONASIS_SUPABASE_SERVICE_KEY=your_service_key
OPENAI_API_KEY=your_openai_key

# Optional
TRANSPORT=stdio  # or 'http' for HTTP mode
PORT=3010        # HTTP port (default: 3010)

Usage

Stdio Mode (Default)

# Development
npm run dev

# Production
npm start

HTTP Mode

# Development
npm run dev:http

# Production
npm run start:http

Available Tools

1. memory_analyze_patterns

Analyze usage patterns and trends in your memory collection.

{
  "user_id": "uuid",
  "time_range_days": 30,
  "response_format": "markdown"
}

Returns:

  • Memory distribution by type and time
  • Peak activity periods
  • Tag frequency analysis
  • AI-generated productivity insights

2. memory_suggest_tags

Get AI-powered tag suggestions for a memory.

{
  "memory_id": "uuid",
  "user_id": "uuid",
  "max_suggestions": 5,
  "include_existing_tags": true
}

Returns:

  • Tag suggestions with confidence scores
  • Reasoning for each suggestion
  • Consistency with existing tag vocabulary

3. memory_find_related

Find semantically related memories using vector similarity.

{
  "memory_id": "uuid",
  "user_id": "uuid",
  "limit": 10,
  "similarity_threshold": 0.7
}

Returns:

  • Related memories ranked by similarity
  • Shared tags between memories
  • Content previews

4. memory_detect_duplicates

Identify potential duplicate or near-duplicate memories.

{
  "user_id": "uuid",
  "similarity_threshold": 0.9,
  "max_pairs": 20
}

Returns:

  • Duplicate pairs with similarity scores
  • Recommendations (keep_newer, merge, etc.)
  • Estimated storage savings

5. memory_extract_insights

Extract key insights and patterns from your knowledge base.

{
  "user_id": "uuid",
  "topic": "optional focus area",
  "memory_type": "project",
  "max_memories": 20
}

Returns:

  • Categorized insights (patterns, learnings, opportunities, risks, action items)
  • Supporting evidence from memories
  • Confidence scores
  • Executive summary

6. memory_health_check

Analyze the organization quality of your memory collection.

{
  "user_id": "uuid",
  "response_format": "markdown"
}

Returns:

  • Overall health score (0-100)
  • Embedding coverage
  • Tagging consistency
  • Type balance analysis
  • Actionable recommendations

Integration with @lanonasis/mcp-core

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)   │
            └─────────────────┘

Example Workflow

  1. Create memory using @lanonasis/mcp-core
  2. Get tag suggestions from memory_suggest_tags
  3. Update memory with suggested tags using core server
  4. Find related memories to build knowledge connections
  5. Extract insights periodically to surface learnings
  6. Run health checks to maintain organization quality

Claude Desktop Integration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "lanonasis-core": {
      "command": "node",
      "args": ["/path/to/mcp-core/dist/index.js"],
      "env": {
        "ONASIS_SUPABASE_URL": "...",
        "ONASIS_SUPABASE_SERVICE_KEY": "...",
        "OPENAI_API_KEY": "..."
      }
    },
    "memory-intelligence": {
      "command": "node",
      "args": ["/path/to/memory-intelligence-mcp-server/dist/index.js"],
      "env": {
        "ONASIS_SUPABASE_URL": "...",
        "ONASIS_SUPABASE_SERVICE_KEY": "...",
        "OPENAI_API_KEY": "..."
      }
    }
  }
}

Testing with MCP Inspector

npx @modelcontextprotocol/inspector dist/index.js

Response Formats

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 */ }
}

Error Handling

Tools return actionable error messages:

{
  "isError": true,
  "content": [
    {
      "type": "text",
      "text": "Error analyzing patterns: Database connection failed. Try checking your ONASIS_SUPABASE_URL environment variable."
    }
  ]
}

Performance Considerations

  • Duplicate detection: Limited to 500 memories for performance
  • Insight extraction: Uses GPT-4o-mini for cost efficiency
  • Vector search: Requires embeddings in your memory_entries table
  • Response truncation: Automatic at 50,000 characters

Prerequisites

Your Supabase database must have:

  1. memory_entries table with embedding column (vector)
  2. match_memories RPC function for vector similarity search
  3. Standard LanOnasis schema (id, title, content, type, tags, etc.)

Architecture Benefits

vs. Embedding in Core Server

| 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 |

Future Enhancements

  • [ ] Memory clustering with topic detection
  • [ ] Automatic summarization of memory collections
  • [ ] Knowledge graph visualization
  • [ ] Anomaly detection in memory patterns
  • [ ] Content quality scoring
  • [ ] Multi-language support

Publishing

npm Publishing

# Build and verify the package
npm run publish:dry-run

# Publish to npm (requires npm login)
npm run publish:npm

GitHub Packages Publishing

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - See LICENSE for details.


Built with ❤️ for the LanOnasis platform by following MCP best practices.