Skip to content

Quickstart

Install

bash
npm install @pensieve-ai/react @pensieve-ai/client
# or
pnpm add @pensieve-ai/react @pensieve-ai/client

@pensieve-ai/react ships pre-built ESM. Peer dependencies — React and React DOM 18+ — must already be present in your project.

bash
# peer deps (if not already installed)
npm install react react-dom

Import the stylesheet

Pensieve's components use scoped Tailwind CSS compiled into a single stylesheet. Import it once at the top level of your application:

ts
import "@pensieve-ai/react/styles.css";

Add the provider and a view

tsx
import { PensieveProvider } from "@pensieve-ai/react";
import { PensieveGraph }    from "@pensieve-ai/react/graph";
import "@pensieve-ai/react/styles.css";

export function PensievePanel() {
  return (
    <PensieveProvider
      endpoint="https://pensieve.acme.internal"
      auth={{ token: "pv-abc123" }}
      database="prod"
    >
      <div style={{ height: 600 }}>
        <PensieveGraph />
      </div>
    </PensieveProvider>
  );
}

That is the complete setup. PensieveProvider creates an isolated React Query client and injects the theme tokens; PensieveGraph loads graph data from the connected server and renders it.

What each import does

ImportPurposeBundle note
@pensieve-ai/reactPensieveProvider, hooks, utilitiesCore; no heavy UI deps
@pensieve-ai/react/graphPensieveGraphAdds react-force-graph-2d (WebGL canvas)
@pensieve-ai/react/queryPensieveQueryEditorAdds @monaco-editor/react (Monaco)
@pensieve-ai/react/discoverPensieveDiscoverStreaming search UI; no extra heavy deps
@pensieve-ai/react/dashboardsPensieveDashboardAdds react-grid-layout + echarts
@pensieve-ai/react/agentPensieveAgentChatSSE streaming chat; no extra heavy deps
@pensieve-ai/react/styles.cssAll component CSSImport once per app

Each subpath is a separate bundle entry, so if you only render PensieveGraph, Monaco and ECharts are never loaded.

Next steps

  • Authentication — configure tokens or OIDC
  • CORS — allow the browser to reach the Pensieve server
  • Theming — match your brand
  • Components — full prop tables for every component

An open-source project · MIT licensed.