embedGrants (cron 04:15, after the ingest crons): open grants with a
synopsis and no vector → buildGrantEmbeddingText (pure, tested:
title+funder+program areas+synopsis, 8K cap) → gemini-embedding-001 @
1536 dims RETRIEVAL_DOCUMENT (org profiles will embed as
RETRIEVAL_QUERY on the other side) → grants.synopsis_embedding.
Chunked embed→store (100/chunk) so failures resume from the last
stored chunk; 500/run spend cap.
Core: serverListGrantsNeedingEmbedding (open+unembedded, closest
deadline first), serverSetGrantEmbeddings. Worker gains
@novelpad/outreach-ai dep; wired into main.ts and run-once (incl. the
missed run-once deps injection).
Live-verified: 199/199 open grants embedded in 16s; semantic probe
('after-school STEM education for youth') ranks NCI Youth Enjoy
Science R25 first at 0.639 cosine via the hnsw index.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
37 lines
1.0 KiB
JSON
37 lines
1.0 KiB
JSON
{
|
|
"name": "@novelpad/outreach-worker",
|
|
"packageManager": "yarn@4.5.0",
|
|
"type": "module",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "node --env-file=.env --env-file-if-exists=.env.local --import tsx/esm ./src/main.ts",
|
|
"build": "esbuild src/main.ts --bundle --platform=node --format=esm --outfile=build/main.js --packages=external",
|
|
"start": "node ./build/main.js",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run"
|
|
},
|
|
"imports": {
|
|
"#~/*": "./src/*"
|
|
},
|
|
"dependencies": {
|
|
"@dbos-inc/dbos-sdk": "4.17.6",
|
|
"@dbos-inc/drizzle-datasource": "4.17.6",
|
|
"@novelpad/outreach-ai": "workspace:^",
|
|
"@novelpad/outreach-core": "workspace:^",
|
|
"drizzle-orm": "0.44.6",
|
|
"fast-xml-parser": "^4.5.0",
|
|
"pdfjs-dist": "^4.10.38",
|
|
"pg": "8.20.0",
|
|
"tsx": "^4.19.2"
|
|
},
|
|
"devDependencies": {
|
|
"@novelpad/config": "workspace:^",
|
|
"@types/node": "^22",
|
|
"@types/pg": "8.20.0",
|
|
"esbuild": "^0.24.0",
|
|
"typescript": "^5.9.3",
|
|
"vitest": "^3.2.4"
|
|
}
|
|
}
|