Browser-only knowledge management packages for React, PGlite, semantic search, and agent tool integration
Full PostgreSQL in the browser with PGlite WASM, typed React 19 hooks, SKOS tagging, Knowledge Shard import/export, local AI capability wiring, and JSON format parity with the Fortemi server.
pnpm add @fortemi/core @fortemi/react
pnpm devGet Started · Packages · Features · AI Capabilities · Documentation · License
fortemi-react is a browser-only knowledge management toolkit. It gives React applications a local PostgreSQL-compatible archive using PGlite, repository APIs for notes and knowledge structures, optional local AI capability wiring, and typed hooks for building production UI without a server.
Use it when you need local-first note storage, semantic retrieval, agent-readable tool functions, or portable Knowledge Shard archives inside a web application.
Install the published packages:
pnpm add @fortemi/core @fortemi/react
# or
npm install @fortemi/core @fortemi/reactRun the standalone app from this repository:
pnpm install
pnpm dev # http://localhost:5173Minimal React setup:
import { FortemiProvider, useCreateNote, useSearch } from '@fortemi/react'
export function App() {
return (
<FortemiProvider persistence="opfs" archiveName="default">
<Notebook />
</FortemiProvider>
)
}
function Notebook() {
const { createNote } = useCreateNote()
const { data, search } = useSearch()
return (
<main>
<button onClick={() => void createNote({ title: 'Hello', content: 'First note.' })}>
Add note
</button>
<input onChange={(event) => void search(event.target.value)} />
<ul>
{data?.items.map((item) => <li key={item.id}>{item.title}</li>)}
</ul>
</main>
)
}| Package | Published | Purpose |
|---|---|---|
@fortemi/core |
npm | Headless data layer: PGlite repositories, migrations, workers, tool helpers, event bus, capability system |
@fortemi/react |
npm | React 19 provider and hooks for notes, search, tags, collections, jobs, capabilities, shards, embedding sets, similarity graphs, and communities |
@fortemi/standalone |
workspace app | Vite application for local development and static deployment |
All packages are versioned together. The current release is 2026.5.4.
- Full note CRUD with revision history, soft delete, starring, pinning, and archiving
- PGlite-backed local storage with
opfs,idb, andmemorypersistence modes - Full-text search with PostgreSQL
tsvector/tsquery, phrase search, filters, facets, and snippets - Hybrid semantic search with pgvector HNSW and BM25 reciprocal-rank fusion
- Virtual embedding-set selectors, cached similarity graphs, and graph/community artifact persistence
- Dynamic and user-authored communities with React graph-controller hooks for source switching
- Tags, collections, inter-note links, SKOS schemes, concepts, and relations
- Knowledge Shard tar.gz import/export with checksums and JSON format parity
- 10 manifest-backed Fortemi tools plus 11 exported direct tool helper functions
- Optional embeddings, LLM, local-provider discovery, WebGPU detection, and fallback routing
- React 19 hooks for common UI workflows and direct context access for lower-level integration
| Runtime | Storage | AI capability notes |
|---|---|---|
| Chrome 113+ / Edge 113+ | OPFS recommended | WebGPU available when enabled; Linux Chrome may require flags |
| Firefox 111+ | IndexedDB fallback | WASM embeddings work; WebGPU production support is limited |
| Safari 17+ | Memory or IndexedDB depending context | Use memory for previews and tests when persistence is restricted |
No backend is required. Deploy apps/standalone/dist/ to any static host.
fortemi-react supports opt-in capabilities through the runtime capability manager:
| Capability | Runtime | Enables |
|---|---|---|
| Semantic embeddings | transformers.js WASM | Hybrid search, related notes, link discovery |
| Local LLM | WebLLM / compatible provider | AI revision, concept tagging, title generation |
| GPU detection | WebGPU adapter probing | Hardware tier and model-fit guidance |
| Local provider discovery | Ollama, LM Studio, llama.cpp, vLLM, Jan | Remote/local provider fallback routing |
On Linux Chrome, local WebGPU inference commonly needs:
google-chrome --enable-features=Vulkan --enable-unsafe-webgpu http://localhost:5173@fortemi/core exports fortemiManifest for bridge registration and direct helper functions for application code. The manifest currently includes:
capture_knowledge, manage_note, search, get_note, list_notes, manage_tags, manage_collections, manage_links, manage_archive, manage_capabilities.
Direct helper exports also include manageAttachments for attachment metadata and blob operations.
pnpm install
pnpm typecheck
pnpm lint
pnpm test:core
pnpm test:e2e
pnpm buildThe repository uses Node.js 22, pnpm 10, TypeScript, Vitest, Playwright, and Vite.
| Guide | Description |
|---|---|
| Getting Started | Installation, provider setup, first note, search |
| Search | Text, semantic, and hybrid search modes, filters, RRF fusion, snippets |
| Integration Guide | Embedding in React apps, tool helpers, events, jobs, capabilities |
| API Reference | Full API surface for @fortemi/core and @fortemi/react |
| Deployment | Static hosting, Vite config, browser compatibility, WebGPU, CI/CD |
| Extending | Custom tools, job handlers, capabilities, migrations, hooks |
| Supply Chain | Release signing, workflow pinning, and publishing controls |
AGPL-3.0-only. See LICENSE.