Query Your Private Docs with AI and Get Citation-Backed Answers
Ever wished you could ask an AI a question about your internal documentation, a private PDF, or a company memo and get a precise answer that actually shows its work? Most AI tools either require you to upload sensitive data to a third-party service or can't tell you where in your documents the answer came from. That's a deal-breaker for a lot of private or proprietary information.
Enter AgentField. It's a local, open-source tool that lets you point a powerful AI (Google's Gemini) at your own collection of documents. You get clear, conversational answers, and crucially, it cites the exact source document and passage it used. No data leaves your machine, and you can verify every claim.
What It Does
In simple terms, AgentField is a local retrieval-augmented generation (RAG) system. You give it a folder of documents (PDFs, text files, etc.), it processes and indexes them locally, and then you can ask questions in a clean web interface. It searches through your docs, finds relevant snippets, and instructs Gemini to compose an answer based solely on that context. The final answer includes inline citations (like [1]) that link back to the source material.
Why It's Cool
The "cool factor" here isn't just about using a large language model; it's about the specific choices that make this practical for developers and teams.
- Privacy-First & Local: Everything runs on your machine. Your sensitive documents never get uploaded to an external API (except for the Gemini API call for the final answer generation, which only sends the extracted text snippets, not the whole files). The embedding model and vector database are local.
- Verifiable Answers: The citation feature is the star. No more guessing if the AI is hallucinating an answer about your project's API. You can click the citation and immediately see the source text it referenced. This builds trust.
- Clean, Simple Stack: It leverages solid, modern tools:
chromadbfor the local vector store,Ollamafor running local embedding models, and Google'sGeminiAPI for the final answer synthesis. It's a great example of a practical RAG pipeline. - Developer-Friendly: It's a Python project with clear setup instructions. It's the kind of tool you can get running in an afternoon, understand, and even modify for your own needs.
How to Try It
Getting started is straightforward if you're comfortable in a terminal. You'll need Python, an Ollama instance running locally, and a Google AI Studio API key for Gemini.
Clone the repo: