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 🙏

© 2025 – Pkg Stats / Ryan Hefner

plexity

v0.1.7

Published

All-in-one SDK for GraphRAG with autonomous schema management and platform integration

Readme

Plexity SDK

All-in-one SDK for GraphRAG with autonomous schema management and platform integration

Plexity is the unified SDK that consolidates all GraphRAG capabilities into a single, easy-to-use package. Instead of installing multiple packages, you get everything you need in one place.

Installation

npm install plexity

That's it! No need to install @plexity/graphrag, @plexity/observability-sdk, or @plexity/sdk separately.

Features

  • Unified API - Single import for all GraphRAG operations
  • Auto-Configuration - Fetch configuration from Plexity platform automatically
  • Schema Management - Automatic schema version detection and migration
  • Built-in Observability - Telemetry and monitoring out of the box
  • Type-Safe - Full TypeScript support with comprehensive types
  • Production-Ready - Battle-tested components from proven packages

Quick Start

Basic Usage

import { PlexitySDK } from 'plexity';

// Initialize with auto-configuration from platform
const sdk = new PlexitySDK({
  apiKey: process.env.PLEXITY_API_KEY,
  orgId: 'your-org-id',
  environment: 'prod'
});

// SDK fetches config from platform
await sdk.init();

// Index documents
await sdk.indexDocuments([
  {
    id: 'doc1',
    content: 'AWS Lambda is a serverless compute service...',
    metadata: { source: 'docs' }
  }
]);

// Shutdown gracefully
await sdk.shutdown();

Manual Configuration

If you prefer to provide configuration manually:

import { PlexitySDK } from 'plexity';

const sdk = new PlexitySDK({
  apiKey: process.env.PLEXITY_API_KEY,
  orgId: 'your-org-id',
  autoConfig: false,
  graphConfig: {
    llm: {
      provider: 'openai',
      apiKey: process.env.OPENAI_API_KEY,
      model: 'gpt-4o-mini'
    },
    embedding: {
      provider: 'openai',
      apiKey: process.env.OPENAI_API_KEY,
      model: 'text-embedding-3-small'
    },
    storage: {
      graph: {
        provider: 'neo4j',
        uri: process.env.NEO4J_URI,
        username: process.env.NEO4J_USERNAME,
        password: process.env.NEO4J_PASSWORD
      },
      vector: {
        provider: 'pinecone',
        apiKey: process.env.PINECONE_API_KEY,
        indexName: 'my-index'
      }
    }
  }
});

// No need to call init() with manual config
await sdk.indexDocuments(documents);

Schema Management

Plexity automatically manages schema versions and migrations:

import { PlexitySDK } from 'plexity';

const sdk = new PlexitySDK({
  apiKey: process.env.PLEXITY_API_KEY,
  orgId: 'your-org-id'
});

await sdk.init();

// Check for schema changes
const diff = await sdk.schema.compareWithPlatform('1.2.0');
console.log('Schema has changes:', diff.hasChanges);

// Push new schema version to platform
await sdk.schema.pushSchema({
  version: '1.2.0',
  entityExtractionPrompt: 'Extract all entities...',
  relationshipExtractionPrompt: 'Extract relationships...',
  llmModel: 'gpt-4o-mini',
  embeddingModel: 'text-embedding-3-small'
});

// Trigger migration for outdated data
const job = await sdk.schema.triggerMigration('1.1.0', '1.2.0', '[email protected]');
console.log('Migration job ID:', job.id);

Direct GraphRAG Access

Access the underlying GraphRAG SDK for advanced operations:

import { PlexitySDK } from 'plexity';

const sdk = new PlexitySDK({
  apiKey: process.env.PLEXITY_API_KEY,
  orgId: 'your-org-id'
});

await sdk.init();

// Get GraphRAG SDK instance
const graphSDK = sdk.getGraphSDK();

// Use GraphRAG methods directly
const result = await graphSDK.search({
  query: 'What is AWS Lambda?',
  mode: 'hybrid'
});

console.log('Answer:', result.answer);
console.log('Citations:', result.citations);

Re-exported APIs

Plexity re-exports all functionality from its component packages:

// From @plexity/graphrag
import {
  GraphRAGOrchestrator,
  GraphRAGObservabilityTracker,
  DocumentChangeDetector,
  ProvenanceTracker,
  IncrementalIndexer,
  type GraphRAGConfig,
  type Document,
  type Entity,
  type Relationship
} from 'plexity';

// From @plexity/observability-sdk
import {
  ObservabilitySDK,
  GraphRAGObservabilityClient,
  type TelemetryEvent,
  type TelemetryBatch
} from 'plexity';

// From @plexity/sdk
import {
  GraphRAGSDK,
  PlexityClient,
  type GraphRAGSDKOptions
} from 'plexity';

What's Included

Plexity consolidates these packages:

  • @plexity/graphrag - Core GraphRAG functionality

    • Entity and relationship extraction
    • Knowledge graph construction
    • Hybrid search (global/local/combined)
    • Community detection
    • Incremental indexing
    • Document versioning
    • Provenance tracking
  • @plexity/observability-sdk - Telemetry and monitoring

    • Entity/relationship event tracking
    • Query coverage analysis
    • Indexing operation metrics
    • Schema/topology snapshots
    • Buffered async shipping
    • Circuit breaker for reliability
  • @plexity/sdk - Platform integration

    • API client for Plexity platform
    • Configuration management
    • Team integrations
    • Webhook management
    • Cron scheduling

Migration from Multiple Packages

If you're currently using multiple packages:

// Before (multiple packages)
import { GraphRAGOrchestrator } from '@plexity/graphrag';
import { ObservabilitySDK } from '@plexity/observability-sdk';
import { PlexityClient } from '@plexity/sdk';

// After (single package)
import { GraphRAGOrchestrator, ObservabilitySDK, PlexityClient } from 'plexity';
// Or use the unified SDK
import { PlexitySDK } from 'plexity';

TypeScript Support

Plexity is written in TypeScript and includes comprehensive type definitions:

import type {
  PlexitySDKOptions,
  SchemaVersion,
  SchemaDiff,
  MigrationJob,
  GraphRAGConfig,
  Document,
  Entity,
  Relationship
} from 'plexity';

Support

  • Documentation: https://docs.plexity.ai
  • Issues: https://github.com/plexity/plexity-orchestrator/issues
  • Discord: https://discord.gg/plexity

License

MIT