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

@renseiai/agentfactory-code-intelligence

v0.8.19

Published

Code intelligence for AgentFactory — tree-sitter AST parsing, BM25 search, incremental indexing, memory deduplication

Downloads

1,560

Readme

@renseiai/agentfactory-code-intelligence

Code intelligence for AgentFactory agents — regex-based symbol extraction, BM25 search, incremental Merkle-tree indexing, PageRank repo maps, and memory deduplication.

Part of the AgentFactory monorepo.

Installation

npm install @renseiai/agentfactory-code-intelligence

Features

| Module | What it does | |--------|-------------| | Parser | Extracts symbols (functions, classes, types, interfaces) from TypeScript, Python, Go, and Rust using regex-based extractors | | Search | BM25-ranked code search with code-aware tokenization (camelCase splitting, stop-word removal) and exact/fuzzy match boosting | | Indexing | Merkle-tree change detection with git-compatible hashing — only re-indexes files that changed | | Repo Map | Builds a dependency graph from imports, ranks files by PageRank, and outputs an LLM-friendly repository map | | Memory | Two-tier deduplication: xxHash64 for exact matches, SimHash for near-duplicates with configurable Hamming distance |

Usage

Symbol extraction

import { SymbolExtractor } from '@renseiai/agentfactory-code-intelligence'

const extractor = new SymbolExtractor()
const ast = extractor.extractFromSource(sourceCode, 'src/index.ts')

for (const symbol of ast.symbols) {
  console.log(`${symbol.kind}: ${symbol.name} (line ${symbol.line})`)
}

Code search

import { SearchEngine, SymbolExtractor } from '@renseiai/agentfactory-code-intelligence'

const extractor = new SymbolExtractor()
const engine = new SearchEngine()

// Extract symbols from your files, then build the index
const symbols = files.flatMap(f => extractor.extractFromSource(f.content, f.path).symbols)
engine.buildIndex(symbols)

const results = engine.search({ query: 'handleRequest', maxResults: 10 })

Incremental indexing

import { IncrementalIndexer, SymbolExtractor } from '@renseiai/agentfactory-code-intelligence'

const indexer = new IncrementalIndexer(new SymbolExtractor())

// Load previous index (if any)
await indexer.load(process.cwd())

// Index files — only changed files are re-processed
const files = new Map([['src/app.ts', sourceCode]])
const { changes, indexed, metadata } = await indexer.index(files)

console.log(`${changes.added.length} added, ${changes.modified.length} modified`)

// Persist for next run
await indexer.save(process.cwd())

Repository map

import { SymbolExtractor, RepoMapGenerator } from '@renseiai/agentfactory-code-intelligence'

const extractor = new SymbolExtractor()
const generator = new RepoMapGenerator()

const asts = files.map(f => extractor.extractFromSource(f.content, f.path))
const entries = generator.generate(asts, { maxFiles: 30 })

console.log(generator.format(entries))

Memory deduplication

import { DedupPipeline, InMemoryStore } from '@renseiai/agentfactory-code-intelligence'

const pipeline = new DedupPipeline(new InMemoryStore())

// Store content
await pipeline.storeContent('entry-1', 'some code block...')

// Check for duplicates
const result = await pipeline.check('some code block...')
// → { isDuplicate: true, matchType: 'exact', existingId: 'entry-1' }

Agent tool plugin

When used with AgentFactory's Claude provider, the package registers four in-process MCP tools:

| Tool | Description | |------|-------------| | af_code_search_symbols | Search symbols by name with kind/language/file filtering | | af_code_get_repo_map | PageRank-ranked repo map of the most important files | | af_code_search_code | BM25 code search with code-aware tokenization | | af_code_check_duplicate | xxHash64 exact + SimHash near-duplicate detection |

import { codeIntelligencePlugin } from '@renseiai/agentfactory-code-intelligence'

// Register with orchestrator
const orchestrator = createOrchestrator({
  toolPlugins: [codeIntelligencePlugin],
})

Supported languages

  • TypeScript / JavaScript
  • Python
  • Go
  • Rust

License

MIT