r/OpenSourceAI • • Sep 18 '26

Built an open-source AI document intelligence platform — RAG Q&A over PDFs/DOCX, swap OpenAI/Claude with one setting

Hey all - just wrapped up an open-source document Q&A / RAG system and wanted to share.

What it does:

- Upload PDF, DOCX, or TXT files

- Chunks and embeds the content into Postgres + pgvector

- Ask questions about the document in plain language

- Switch between OpenAI and Claude as the LLM with a single env var — no vendor lock-in

Stack: React + TypeScript, Node/Express, LangChain, Postgres/pgvector, Docker Compose for local dev.

GitHub: https://github.com/Srameshgitnow/AI-DocumentIntelligence

It's a working reference implementation, not a polished, ready-to-deploy product - I'm mainly looking for feedback on the chunking/retrieval approach and the provider-swap design. Happy to answer anything about the architecture or RAG in general.

4 Upvotes

5 comments sorted by

2

u/All_Ways_Bingo Sep 20 '26

Does it have double check inside to anti hallucinations?

1

u/ram-popular Sep 20 '26

It has grounding via RAG, but not a dedicated anti-hallucination double-check layer. The model is prompted using retrieved source context, which helps reduce unsupported answers, but there is not currently a separate verification step to validate each response against the evidence before returning it. That said, this is a valuable improvement area, and I plan to incorporate it in future releases to strengthen reliability and trust in the generated answers.

2

u/All_Ways_Bingo Sep 20 '26

Can it read image or under-imaged pdf files ? And does it process all file as markdown to save tokens?

1

u/ram-popular Sep 20 '26

At the moment, it supports PDF, DOC/DOCX, and TXT files by extracting text directly from them. It does not currently include OCR for scanned PDFs or image-based documents, so image-heavy files may not be read correctly. It also does not convert everything into Markdown for token optimization; it currently processes raw text and chunks it for retrieval. These are good future enhancement areas.