{"_id":"@economicagents/indexer","_rev":"2-6128732814386912c47ef7e9fb80b8a3","name":"@economicagents/indexer","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@economicagents/indexer","version":"0.1.0","keywords":["aep","agent","erc-8004","indexer","intent-resolution"],"license":"Apache-2.0","_id":"@economicagents/indexer@0.1.0","maintainers":[{"name":"agenteconomicprotocol","email":"economicagents@proton.me"}],"homepage":"https://github.com/economicagents/AEP#readme","bugs":{"url":"https://github.com/economicagents/AEP/issues"},"bin":{"aep-index":"dist/cli.js"},"dist":{"shasum":"572e130b59059f8cc9b7a1fd583beaf5cf500128","tarball":"https://registry.npmjs.org/@economicagents/indexer/-/indexer-0.1.0.tgz","fileCount":30,"integrity":"sha512-OFW/pIIOHAAr62wl+Fm4sFFwSaaP83p10aq7Q7VFRdhn8c6GjtqWjrQNVEFT9DLW61SyMeqqf55/hq/EmZAy0Q==","signatures":[{"sig":"MEUCICd3XNLesxlOXJHf55J2+E6ulZy5Y8W02/ag7Pmmu5xAAiEAmQ6URty9df/yfYos9jUrMUtVhgotSASbp3xh3c4GNI0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49656},"main":"dist/index.js","type":"module","_from":"file:economicagents-indexer-0.1.0.tgz","types":"./dist/index.d.ts","scripts":{"dev":"tsc --watch","sync":"node dist/cli.js sync","test":"vitest run","build":"tsc","test:watch":"vitest"},"_npmUser":{"name":"agenteconomicprotocol","email":"economicagents@proton.me"},"_resolved":"/private/var/folders/ng/hdr03f0n1q19hp067_02twc00000gn/T/b8e5a295698899c1f90fb198f7819554/economicagents-indexer-0.1.0.tgz","_integrity":"sha512-OFW/pIIOHAAr62wl+Fm4sFFwSaaP83p10aq7Q7VFRdhn8c6GjtqWjrQNVEFT9DLW61SyMeqqf55/hq/EmZAy0Q==","repository":{"url":"git+https://github.com/economicagents/AEP.git","type":"git"},"_npmVersion":"11.6.1","description":"Provider discovery index for AEP intent resolution - crawls ERC-8004, indexes capabilities and pricing","directories":{},"_nodeVersion":"24.10.0","dependencies":{"viem":"^2.21.0","@economicagents/sdk":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.6.0","@types/better-sqlite3":"^7.6.11"},"optionalDependencies":{"sqlite-vec":"^0.1.0","better-sqlite3":"^12.1.0"},"_npmOperationalInternal":{"tmp":"tmp/indexer_0.1.0_1773960697435_0.7776502061068566","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@economicagents/indexer","version":"0.2.0","description":"Provider discovery index for AEP intent resolution - crawls ERC-8004, indexes capabilities and pricing","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/economicagents/AEP.git"},"bugs":{"url":"https://github.com/economicagents/AEP/issues"},"homepage":"https://github.com/economicagents/AEP#readme","keywords":["aep","agent","erc-8004","indexer","intent-resolution"],"publishConfig":{"access":"public"},"type":"module","main":"dist/index.js","bin":{"aep-index":"dist/cli.js"},"dependencies":{"commander":"^12.1.0","pg":"^8.13.1","viem":"^2.47.5","@economicagents/sdk":"0.2.0","@economicagents/viem-rpc":"0.2.0"},"optionalDependencies":{"better-sqlite3":"^12.1.0","sqlite-vec":"^0.1.0"},"devDependencies":{"@types/better-sqlite3":"^7.6.11","@types/pg":"^8.11.10","typescript":"^5.6.0","vitest":"^2.1.0"},"scripts":{"build":"tsc","dev":"tsc --watch","sync":"node dist/cli.js sync","test":"vitest run","test:watch":"vitest"},"types":"./dist/index.d.ts","_id":"@economicagents/indexer@0.2.0","_integrity":"sha512-/x8hGPJkWF2y4GZqTd8AoqUnlZ7kLbtoI4tM/r8Syy5x5l02/Ma7c54O4dEqa1gj7zluVW7L3MOPA6KtzrPoKQ==","_resolved":"/private/var/folders/ng/hdr03f0n1q19hp067_02twc00000gn/T/9bb30ea7ddf01381cdd9914becc5014b/economicagents-indexer-0.2.0.tgz","_from":"file:economicagents-indexer-0.2.0.tgz","_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-/x8hGPJkWF2y4GZqTd8AoqUnlZ7kLbtoI4tM/r8Syy5x5l02/Ma7c54O4dEqa1gj7zluVW7L3MOPA6KtzrPoKQ==","shasum":"7c5bdb53068adddcb3b5b3f37a7d4899ef376d82","tarball":"https://registry.npmjs.org/@economicagents/indexer/-/indexer-0.2.0.tgz","fileCount":65,"unpackedSize":83717,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICF51i48fLPQMYw8Dd/lnk1BETP5HxyCYwGE3OntzYTTAiEA7b8xWT+TFRbIixN4xePZMGEs4l96g4qk0R7Gn5KGVtk="}]},"_npmUser":{"name":"agenteconomicprotocol","email":"economicagents@proton.me"},"directories":{},"maintainers":[{"name":"agenteconomicprotocol","email":"economicagents@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/indexer_0.2.0_1774467902414_0.5883119180281868"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T22:51:37.322Z","modified":"2026-03-25T19:45:02.683Z","0.1.0":"2026-03-19T22:51:37.583Z","0.2.0":"2026-03-25T19:45:02.552Z"},"bugs":{"url":"https://github.com/economicagents/AEP/issues"},"license":"Apache-2.0","homepage":"https://github.com/economicagents/AEP#readme","keywords":["aep","agent","erc-8004","indexer","intent-resolution"],"repository":{"type":"git","url":"git+https://github.com/economicagents/AEP.git"},"description":"Provider discovery index for AEP intent resolution - crawls ERC-8004, indexes capabilities and pricing","maintainers":[{"name":"agenteconomicprotocol","email":"economicagents@proton.me"}],"readme":"# @economicagents/indexer\n\nProvider discovery for AEP intent resolution: crawl ERC-8004 registries, index capabilities and pricing, optional **SQLite FTS5** or **PostgreSQL + pgvector** hybrid search.\n\n## Install\n\n```bash\npnpm add @economicagents/indexer\n```\n\nThe **`aep-index`** CLI is available when installed globally or via `pnpm exec`.\n\n**From a local clone** of [economicagents/AEP](https://github.com/economicagents/AEP): `cd packages/indexer && pnpm run build`.\n\n## Usage\n\n```bash\n# When package is on PATH\naep-index sync [--rpc <url>] [--probe-x402]\naep-index embed\naep-index migrate   # when using PostgreSQL (see below)\n\n# From packages/indexer after build\nnode dist/cli.js sync [--probe-x402]\nnode dist/cli.js embed\nnode dist/cli.js migrate\n```\n\nDefault index path: `~/.aep/index/`. Consumed by `@economicagents/resolver`, REST `POST /resolve`, MCP `resolve_intent`, and `aep resolve`.\n\n## PostgreSQL + pgvector (optional)\n\nFor hosted or high-scale search, run Postgres with the **pgvector** extension (see `docker/docker-compose.yml`).\n\n1. Set **`AEP_INDEX_DATABASE_URL`** (or **`indexDatabaseUrl`** in `~/.aep/config.json`).\n2. Run **`aep-index migrate`** once to apply SQL migrations from `migrations/`.\n3. Run **`aep-index sync`** then **`aep-index embed`**.\n4. Set **`OPENAI_API_KEY`** for embeddings (`embed`) and for **hybrid** lexical + vector search at query time. Without the key, search uses **lexical** (`tsvector`) only.\n\nOptional: **`AEP_EMBEDDING_MODEL`** (default `text-embedding-3-small`), **`AEP_INDEX_DATASET_ID`** (override dataset namespace).\n\n## Operations\n\n- **Embedding dimension:** `migrations/002_provider_search.sql` defines `vector(1536)` to match `text-embedding-3-small` (see `EMBEDDING_DIMENSIONS` in `src/embeddings.ts`). Switching to a model with a different output width requires a **new SQL migration** (or schema change), not only `AEP_EMBEDDING_MODEL`.\n- **Connection pool:** The CLI exits after each command, so the `pg` pool is released with the process. Long-lived services that import this package and set `AEP_INDEX_DATABASE_URL` should call **`closePgPool()`** when shutting down (e.g. graceful shutdown) to avoid holding connections open indefinitely.\n- **Stale rows:** Each `sync` rebuilds `provider_search` for the current provider set and **deletes** rows for that dataset whose `agent_id` is no longer present, so removed agents do not linger in Postgres.\n\n## Configuration\n\n- **RPC:** `--rpc <url>` or config / `AEP_RPC_URL`\n- **Chain:** `AEP_CHAIN_ID` (default: 84532 Base Sepolia)\n- **Config:** `~/.aep/config.json` (`indexPath` overrides default index directory)\n- **DB:** `AEP_INDEX_DATABASE_URL` or `indexDatabaseUrl` in config\n\n## Dependencies\n\n- **PostgreSQL:** runtime dependency `pg` when using the DB URL (migrations ship in the published package under `migrations/`).\n- **SQLite path:** optional `better-sqlite3` (v12+), `sqlite-vec`. Without them when no DB URL is set, discovery falls back to legacy keyword search.\n\n## Build & test\n\n```bash\npnpm run build\npnpm run test\n```\n\n## Documentation\n\n- [Cookbook](https://github.com/economicagents/AEP/blob/main/docs/COOKBOOK.md) — Intent resolution setup\n- [Deployment](https://github.com/economicagents/AEP/blob/main/docs/guides/deployment.md) — Index after deploy\n","readmeFilename":"README.md"}