跳到正文
DEV Community· Abhay Singh·· 3 小時前AI 評分41

InfoMind AI Enterprise:讓非結構化資訊擁有智能

InfoMind AI Enterprise: Giving Unstructured Information an Intelligent Mind

AI 導讀

InfoMind AI Enterprise 是一個根據文件內容回答問題的檔案庫,每個答案均附有來源段落,證據不足時會拒答。使用 llama3.2:3b 時,一個可回答的問題在 5 次測試中均遭錯誤拒答;改用 llama3.1:8b 後,同一問題 10 次均獲正確回答。系統可在本機離線運行;使用託管示範時,問題相關段落會傳送至 Ollama 伺服器。

正文

This is my submission for the Hacktoberfest Open-Source AI Challenge: Week 4, "Ghost in the Machine".

What I Built

InfoMind AI Enterprise is a document archive that answers back, and only with what the archive actually says.

You upload documents (PDF, Word, Excel, CSV, text). InfoMind cuts them into passages, indexes them for keyword and meaning-based search, suggests a category for each with a small scikit-learn model (uncertain cases go to a human reviewer), and lets you ask questions. Every answer arrives with the exact passages it came from. If the documents do not contain the answer, it says so:

"The available documents do not contain sufficient evidence to answer this question reliably."

I built it during the challenge window (first commit 28 October 2026) as a full-stack project: React and TypeScript on the front, FastAPI and PostgreSQL behind it, Qdrant for vectors, and Ollama for the language model.

The Spirit of It

The theme asks for something spooky, or something that honours the past. The thing that haunts every AI assistant is the confident answer from nowhere: a ghost in the machine that says things nobody ever wrote. I wanted the opposite, a medium at a séance who only repeats what the dead actually said, and who goes quiet when there is nothing to hear.

An archive is how we honour the past, and an archive you cannot trust is worse than none. So InfoMind treats "I have no evidence for that" as a feature, not a failure.

A fair disclaimer: my demo documents are synthetic office files (policies, a backup runbook, a purchase order), not family letters. The engine works on any text, but I did not build a themed collection in time, and I would rather say that than dress it up.

Demo

  • Live: https://infomind-ai-enterprise.vercel.app
  • To try it (about two minutes): click Create account (sign-up is open, no shared password needed), upload a few files from data/sample/documents (for example backup_runbook.txt, data_retention_policy.txt, acceptable_use_policy.txt), wait a few seconds for them to show completed, then open AI Assistant and ask:
    • How long are nightly database backups retained? (answered: 35 days, with the source passage)
    • What is the capital of Australia? (refused: not enough evidence)
  • The API runs on a free hosting plan, so the first request after a quiet period can take about a minute while it wakes.

The public landing page

An answer with its source passage, then a refusal when the documents are silent

Code

https://github.com/Abhay-s-8/infomind-ai-enterprise (MIT licence). A long, diagram-heavy explanation of every data flow is in docs/PROJECT_EXPLAINED.md.

How I Built It

The assistant is a retrieval-augmented pipeline with several independent checks, because no single one is enough:

How a question becomes an answer or a refusal

  1. Retrieve only from the documents the signed-in user may see.
  2. Evidence gate. If no passage shares enough words with the question, or is close enough in meaning, the model is never called. The refusal costs nothing and cannot hallucinate.
  3. Injection filter. Passages that try to give the model orders, such as telling it to disregard its rules, are dropped before the model sees them.
  4. Strict JSON. The model must return supported, citations, answer, in that order.
  5. Validate citations. An answer counts only if it is marked supported and cites a passage that was really retrieved. The citation text shown to you comes from the stored passage, never from the model.
  6. Stream carefully. Answers appear word by word, but the stream parser holds the text back until it has seen supported: true and a valid citation.

The rest: a database-backed job queue and worker, role-based access (admin, analyst, reviewer) enforced on the server, an audit log, and an evaluation command that exports retrieval and answer-quality numbers. The tests (111 on the backend, plus a frontend suite) run with no model downloads.

Built with an AI coding assistant. I developed this with Claude Code, and this post was drafted with AI help and reviewed by me. The design decisions, the measurements and the limits below are all things I checked against the running system.

Why Open Innovation Matters

This is where open models earned their place.

Swapping the model is one setting, and it changed the result. With the small default model (llama3.2:3b through Ollama), the assistant wrongly refused a question it could answer whenever a second, less relevant passage was also retrieved: 0 out of 5 tries. I tried rewording the prompt and filtering passages; neither held up. Changing one environment variable to llama3.1:8b answered the same question 10 out of 10 times, and the app's own evaluation scored 4/4 answerable questions answered and 3/3 unanswerable ones refused. I could only run that experiment because the model is mine to swap.

Privacy is a deployment choice, not a promise. Run locally, the documents and the questions never leave your machine, and the whole thing works with the internet off. For the always-on demo I used Ollama's hosted cloud so that visitors need nothing installed. Be aware that in that mode, the passages for each question go to Ollama's servers. The hosted demo uses a model called beam, which Ollama describes as an open model built by Reflection; its page does not state a licence, so the open-weight claim in this post rests on the local Llama models, not on beam.

No lock-in. The same code runs against a local Ollama, an Ollama behind a small gateway I wrote, or Ollama's cloud.

Honest limits

  • No OCR yet: scanned PDFs fail with a clear message.
  • All sample data and the classifier's training data are synthetic, so its near-perfect scores say almost nothing about real documents.
  • I have not manually reviewed the assistant's answers for faithfulness; the checks above are automatic. The evaluation is seven questions on a small corpus.
  • The free hosting sleeps when idle, and its database expires on 2026-11-27.

Where to look next

If this made you want an assistant that can say "I don't know", the part to read is the evidence gate and the citation validation in rag_service.py. Contributions are welcome; see CONTRIBUTING.md.

來源:DEV Community · dev.to