ai-hist weekly downloads statistics
By AgentWorkforce · npm · MCP servers
Local history ingestion, storage, evidence, SDK, CLI and MCP server.
ai-hist has 4,139 recorded weekly downloads on npm, a decrease of 81.7% over the past 30 days, ranking #1600 of 3,247 tracked listings.
About ai-hist
ai-hist
The local history TypeScript SDK, Node CLI, and MCP server. Storage and local
ingestion use one mandatory ai-hist-native Node-API engine. Optional source and
destination plugins compose through public interfaces; no JavaScript SQL or
commercial dependency is required by this package.
npm install ai-hist
import {
CATALOG_SOURCES,
discoverSessions,
hydrateSession,
listSessionCatalogPage,
getSession,
getSessionEventsPage,
sessionEvents,
getSessionToolCallsPage,
sessionToolCalls,
getSessionFileEditsPage,
sessionFileEdits,
search,
recent,
stats,
sync,
} from 'ai-hist';
// Runtime validation stays in step with the sources supported by this build.
for (const source of CATALOG_SOURCES) console.log(source);
await discoverSessions({ scope: 'all', limit: 100 });
const page = await listSessionCatalogPage({ scope: 'all', limit: 20 });
const first = page.sessions[0];
if (first) {
await hydrateSession({ source: first.source, sessionId: first.sessionId });
const prompts = await getSession(first.sessionId);
const events = await getSessionEventsPage(first.sessionId, { limit: 200 });
for await (const event of sessionEvents(first.sessionId)) consume(event);
const tools = await getSessionToolCallsPage(first.source, first.sessionId, { limit: 200 });
const edits = await getSessionFileEditsPage(first.source, first.sessionId, { limit: 200 });
for await (const call of sessionToolCalls(first.source, first.sessionId)) consume(call);
for await (const edit of sessionFileEdits(first.source, first.sessionId)) consume(edit);
}
All APIs are async. listSessionCatalog and listSessionCatalogPage are
cache-only. discoverSessions is shallow discovery. hydrateSession is
targeted evidence acquisition for one existing catalog row. It returns
hydrated, updated, unchanged, or capability_limited, an indexed source
stamp, evidence counts, related native session IDs, and bounded-work metrics.
Targeted remote hydration uses scope: 'remote' and an explicitly configured
source plugin registry: Claude web sessions can
return capability: 'full' after complete teleport evidence is acquired;
Codex cloud tasks return partial when their supported unified diff is indexed
or shallow_only when no richer evidence is exposed. Partial results retain
discoveryState: 'shallow'. sync is full ingestion.
Missing databases return empty read results; they do not trigger provider I/O.
SOURCES and CATALOG_SOURCES are immutable runtime registries corresponding to
the exported Source and CatalogSource types. Use isSource(value) or
isCatalogSource(value) to validate untyped input without maintaining a copied
provider list. CATALOG_SOURCES is the same list as SOURCES: every source
can identify a catalog entry.
Session discovery, listing, search, recent history, statistics, and sync accept
scope: 'local' | 'remote' | 'all'. Scope defaults to local, preserving
offline behavior and making provider-cloud access explicit. The CLI exposes the
same mutually exclusive --local, --remote, and --all flags; omitting them
is equivalent to --local.
Cached reads preserve the requested scope and never consult commercial auth.
Stored remote history can be queried with absent, malformed, expired, or
ambiguous credentials. Remote acquisition requires an explicitly loaded plugin
registry. Install @relayhistory/provider-sources for Claude web/Codex
cloud. Installing a package does not register it or inspect auth.
import { HistoryPluginRegistry } from 'ai-hist';
import { createHistoryPlugin } from '@relayhistory/provider-sources';
const plugins = new HistoryPluginRegistry();
plugins.register(createHistoryPlugin({connectors:['claude-web']}));
await discoverSessions({ scope:'remote', plugins, sourceConnectors:['claude-web'] });
await sync({ scope:'all', plugins, sourceConnectors:[] }); // local adapters only
const cached = await stats({ scope:'remote' }); // no login required
The CLI accepts --config history.json on acquisition commands. Config lists
explicit plugin modules/options; --source-connector selects their IDs and is
repeatable. --no-source-connectors disables remote acquisition. MCP uses
AI_HIST_PLUGIN_CONFIG and source_connectors. Scope defaults to local even
with plugins configured. See source plugins.
Native contract 30 requires a matching addon, including current catalog and
source/delivery contracts.
Catalog pages, discovery results, statistics, and sync results echo the requested scope,
and discovery results additionally report locationsRun — the connector
locations that actually executed.
History and catalog rows have locations, containing local, remote, or both, so an
all query still returns one logical session while preserving where it was
found. resumeCommand() returns null for a remote-only history row rather
than emitting a local CLI command; an empty locations array retains legacy
local behavior for rows written before provenance tracking.
The event primitive is page-based and uses { tsMs, id } as a deterministic
cursor. Events with known sourceOrder follow recorded order within each
same-timestamp bucket; null means the provider order is unknown. Cursors resolve
through stable row identity. If an ordered cursor row is removed, restart the
read rather than guessing its old position. Source ranks outside JavaScript's
safe integer range fail with SOURCE_ORDER_NOT_REPRESENTABLE.
The sessionEvents async iterator walks pages without accumulating a
large transcript. getSessionEvents is an explicit collecting convenience.…
Description from the npm listing.
- mcp
- model-context-protocol
- claude
- claude-code
- codex
- cursor
- history
- search
- sqlite
- ai-agent
- ai-cli
- coding-agent
- session-history
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm MCP servers plugins
All 20 ai-hist alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/ai-hist. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.