«««< HEAD
Document infrastructure for RAG, aligned with Scale Dex delivery: upload → parse → chunk/embed into a hosted vector store, then query live via API at retrieval time.
Primary delivery = API, not a flat export file. JSONL export exists only for dev/backup.
Like Scale Dex vector stores:
POST .../vector-store/searchcontent, score, file_id, parse_result_id, blocks, and metadatastorage/Project (= vector store)
→ Upload PDF
→ Parse (PyMuPDF) → ParseResult
→ Chunk + Embed → pgvector index
→ Review (optional human QA)
→ Delivery API: semantic search
→ Optional: RAG JSONL export (dev only)
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/projects/{id}/vector-store |
Store info, counts, embedding model |
POST |
/api/projects/{id}/vector-store/search |
Primary delivery — ranked chunks |
{
"query": "What are the contract termination terms?",
"top_k": 5,
"query_type": "semantic",
"file_id": "optional-file-id"
}
{
"vector_store_id": "...",
"project_id": "...",
"query": "...",
"query_type": "semantic",
"top_k": 5,
"chunks": [
{
"content": "...",
"score": 0.87,
"file_id": "...",
"parse_result_id": "...",
"metadata": { "chunk_id": "...", "page": 3, "filename": "..." },
"blocks": [{ "type": "paragraph", "page_number": 3 }]
}
]
}
Legacy alias: POST /api/projects/{id}/search (same engine, alternate shape).
docker compose up -d --build
copy .env.example .env
npm install
npx prisma migrate deploy
npm run db:seed
npm run dev
Open http://localhost:3000 — the project overview shows delivery API endpoints.
storage/; exports under storage/exports/PARSE_WORKER_URL=http://localhost:8090