A Private Prototype for Document-Grounded Research Agents
23 Sep 2026
One project I’ve been exploring is a small, production-shaped platform for building research agents over a private document collection. The code repository is private, so this post shares the architecture at a high level rather than linking to source.
The ingestion pipeline accepts formats including PDF, Markdown, Python, LaTeX, CSV, and JSON. It deduplicates files with SHA-256, chunks their contents, creates embeddings, and stores them in PostgreSQL with pgvector for cosine-similarity retrieval and HNSW indexing.
Instead of asking a model to generate and execute arbitrary Python, the agent factory produces a validated Pydantic AgentSpec. A research agent follows an explicit flow—query planning, multi-query retrieval, deduplication, and grounded synthesis with source citations—behind a FastAPI API. Docker Compose brings up the application and database, while mock providers allow tests to run without API credentials.
Keeping the agent plan separate from the runtime makes the system easier to inspect and test. I’d be interested to hear how others balance agent flexibility with clear permission boundaries and traceable answers.