# index — repo context

> Curated overview for code_search. Source: `direqt-search/index` (GitHub). Node.js/TypeScript.

## Purpose
**Index service** — the core search + indexing engine. Handles **document
ingestion**, **vector embedding generation**, and **multi-strategy search query
execution**.

- **Document Indexing**: ingests documents (web pages, articles), generates
  **OpenAI embeddings (1536-dim)**, stores in **MongoDB Atlas** with full-text +
  vector search indexes.
- **Search**: pluggable engine architecture combining **vector search, full-text
  search, web search, LLM reranking, and query reformulation**.
- **Multi-tenancy**: all data scoped to a network (org); a network has many
  indexes, each with many documents.

## Structure (top-level dirs)
- `index-api/` — the Index API surface
- `src/` — ingestion + search engines
- `temporalDecay/` — recency/decay scoring
- `config/`, `docs/`, `scripts/`, `test/`
- Runs on **port 8292**.

## Tech
Node.js 22 · TypeScript · Express 4 · MongoDB (Mongoose 8) + Atlas Search ·
OpenAI embeddings (`text-embedding-ada-002`) · GCP Discovery Engine · Zod ·
Mocha tests. Depends on `@direqt-internal/{crawl-api,iam-api,metrics,service-framework}`.
