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

agent-stanley

v0.0.5

Published

A financial research analyst engine that answers questions about public companies using SEC filings (10-K, 10-Q), XBRL structured facts, and earnings call transcripts.

Downloads

433

Readme

Agent Stanley

A financial research analyst engine that answers questions about public companies using SEC filings (10-K, 10-Q), XBRL structured facts, and earnings call transcripts.

Built on the Pi coding-agent runtime by Earendil Works.


What it does

Agent Stanley runs a multi-step research loop:

  1. Resolves a company ticker to a CIK
  2. Fetches and ingests SEC filings via API Ninjas
  3. Retrieves relevant passages using hybrid BM25 + vector search (RRF)
  4. Pulls authoritative XBRL numeric facts directly from EDGAR
  5. Optionally retrieves earnings transcript passages (speaker-attributed)
  6. Computes derived metrics with traceable evidence IDs
  7. Returns a verified AnalystAnswer with key points, tables, caveats, and citations

All numeric values come from XBRL facts — never from model memory. Every claim in the final answer is verified against retrieved evidence before the response is emitted.

Packages

| Package | Description | |---------|-------------| | packages/research-agent | Agent runtime, tools, prompts, verification, and evals | | packages/research-db | Data model, repositories, BM25/vector/hybrid search | | packages/sec-ingestion | SEC filing fetcher, sectionizer, chunker, XBRL ingestor | | packages/transcript-ingestion | Earnings transcript provider, parser, BM25 search | | packages/web-app | Node HTTP server, SSE chat endpoint, browser UI |

Requirements

  • Node.js >=22.19.0
  • API_NINJAS_KEY — SEC filing list and transcript data via API Ninjas
  • SEC_USER_AGENT — required by EDGAR (e.g. "MyApp [email protected]")
  • An LLM provider credential: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, or OPENROUTER_API_KEY
  • Optional: PI_RESEARCH_MODEL="provider/model-id" to pin the model (e.g. openai/gpt-4o)

Install

npm install --ignore-scripts

Global CLI

After publishing to npm, install and run the web server with:

npm install -g agent-stanley
agent-stanley

Create ~/.agent-stanley with your keys (loaded automatically on startup):

API_NINJAS_KEY=...
SEC_USER_AGENT=AgentStanley [email protected]
OPENAI_API_KEY=...

Then just run:

agent-stanley

A .env file in the current working directory is also loaded and takes precedence over ~/.agent-stanley.

Run

# Development (hot reload)
npm run dev

# Production
npm start

The web UI starts at http://localhost:3000. Type a question about any public company.

Build & test

npm run build    # research-db → sec-ingestion → transcript-ingestion → research-agent → web-app
npm test         # all workspaces
npm run check    # biome lint/format + typecheck

# Single package
cd packages/research-agent && npx vitest --run

# Offline evals (no LLM calls, fixture-backed)
cd packages/research-agent && npm run eval

Environment variables

SEC_USER_AGENT="AppName [email protected]"   # required for EDGAR filing downloads
API_NINJAS_KEY="..."                           # required for SEC client and transcripts
OPENAI_API_KEY="..."                           # or any supported provider key
PI_RESEARCH_MODEL="openai/gpt-4o"             # optional; overrides default model
TRANSCRIPT_PROVIDER="fixture"                  # use "fixture" for dev/test (no API calls)
DATABASE_URL="postgres://..."                  # future production target (SQLite selected in ADR 0002)

Guardrails

  • Personalized buy/sell/hold advice is refused (financialAdviceGuard)
  • Every evidence ID in the answer is verified against retrieved passages (citationVerifier)
  • Company-specific numeric or quote claims without evidence are flagged (unsupportedClaimChecker)

Architecture docs

See docs/finance-agent/ for ARCHITECTURE.md, HANDOFF.md, TODO.md, and ADRs.

License

MIT