How dileepwick/vector-doc-engine works
vector-doc-engine is a TypeScript PDF-to-vector-search library and CLI. Users ingest a PDF, which is extracted, recursively chunked, embedded through Gemini with retry handling, and upserted into ChromaDB; they then submit a query, embed it, retrieve candidate chunks, convert distances to similarity scores, and filter results. The graph includes the public exports and major domain stages. Relationships are based on the sampled source and README; ChromaDB and Gemini are external services.
Main entry points: ingest.ts Ingest orchestration · ask.ts Search orchestration · index.ts Public exports · embedder.ts Embedding with retries
Components 13
Library API
- Public exports
src/index.ts
PDF Ingestion
- PDF input
src/ingest.ts - PDF text extraction
src/ingest.ts - Recursive chunking
src/chunker.ts - Ingest orchestration
src/ingest.ts
Semantic Search
- Search query
src/ask.ts - Search orchestration
src/ask.ts - Similarity scoring and filtering
src/ask.ts - Ranked excerpt matches
src/ask.ts
External Services
- Embedding with retries
src/embedder.ts - ChromaDB collection
- Google Gemini API
Other components
- Library user / CLI user
Connections 19
- Library user / CLI user → Public exports: uses exports
README.md - Library user / CLI user → Ingest orchestration: ingests PDF
README.md - Library user / CLI user → Search orchestration: queries documents
README.md - Public exports → Recursive chunking: exports
src/index.ts - Public exports → Embedding with retries: exports
src/index.ts - Public exports → Ingest orchestration: exports
src/index.ts - Public exports → Search orchestration: exports
src/index.ts - Ingest orchestration → PDF input: resolves and reads
src/ingest.ts - Ingest orchestration → PDF text extraction: extracts text
src/ingest.ts - Ingest orchestration → Recursive chunking: chunks text
src/ingest.ts - Ingest orchestration → Embedding with retries: embeds batches
src/ingest.ts - Embedding with retries → Google Gemini API: requests vectors
src/embedder.ts - Ingest orchestration → ChromaDB collection: upserts vectors
src/ingest.ts - Search orchestration → Search query: accepts query
src/ask.ts - Search orchestration → Embedding with retries: embeds query
src/ask.ts - Search orchestration → ChromaDB collection: queries vectors
src/ask.ts - Search orchestration → Similarity scoring and filtering: scores and filters
src/ask.ts - Similarity scoring and filtering → Ranked excerpt matches: returns matches
src/ask.ts - Search orchestration → Google Gemini API: configures API client
src/ask.ts