PROJECT

AI Knowledge Base Software for Cited Answers

Custom software development, Private document ingestion, AI document Q&A, Semantic search, Vector retrieval, Source citations, Document analysis, Analytics

  • Industry: Legal services
  • Italy Location: Italy
  • Delivery time: 16 weeks
  • Technologies: Python, JavaScript / TypeScript (Node.js)
4+ months

This client is a law firm that spends time searching confidential documents for reliable answers. The software takes in private documents and cloud-drive files, then returns natural-language answers grounded in the firm’s knowledge base. Source citations, document names, and page references show where each answer comes from. The platform also supports document analysis, structured extraction, access management, and usage monitoring.

Summary

Problem

The law firm spends time retrieving and reviewing confidential documents before it can answer legal questions.

Solution

The solution became a private AI document question answering platform with semantic retrieval, citations, analysis, and controlled access.

Result

The platform is made to reduce manual document work and unsupported answers while keeping evidence visible.

Client story

The client is a law firm from Italy. It works with confidential legal documents and business data, including contracts, case notes, and litigation documents.

Finding relevant passages and reviewing documents takes time. The firm needs answers that remain traceable to the supplied files.

The request was simple: provide natural-language question answering grounded in private documents, with source citations and document-based analysis.

The solution was shaped as a central knowledge base with controlled access, document ingestion, vector retrieval, and cited answers. Analysis tools and administration followed as separate modules.

The client asked for

  1. Answer questions using supplied documents and organizational data
  2. Show cited sources and reduce unsupported answers
  3. Support semantic, vector, hybrid, and incremental search
  4. Extract, compare, summarize, classify, and report on documents

Why ready-made software did not fit

Ready-made options covered legal assistants and legal data intelligence, but their descriptions did not combine the firm’s private content, required evidence, document ingestion, and analysis in one tailored system. The solution was designed around controlled hosting and access rules. It also followed the firm’s own document workflow and API needs.

Project overview

The solution was designed around a central knowledge base. Users add legal files and connected sources, while processing status and access controls keep the collection understandable and restricted.

To handle mixed document sources, the platform extracts content from PDFs, Word files, and spreadsheets. It also processes scanned documents, websites, Google Drive, and Dropbox content.

The content is divided into passages, converted into vector representations, and stored for retrieval.

The question-answering workspace combines semantic or hybrid search with an AI response. Page references and highlighted passages keep the evidence close to the text.

A separate analysis workspace presents clauses, dates, and parties. It also shows obligations, risks, and summaries.

Comparisons and gap-analysis results help the firm examine document content against reference standards.

Administration covers users, roles, and permissions. It also includes conversation logs and audit activity.

The platform exposes APIs for document processing and retrieval. Its modular structure leaves room for additional forms, automations, integrations, and analysis functions.

Key features delivered

  • Private knowledge base for legal documents
  • Document upload and source filters
  • AI document question answering
  • Semantic, vector, hybrid, and incremental retrieval
  • Source citations with page references
  • Highlighted supporting passages
  • Document and clause analysis
  • Structured field extraction
  • Comparison and gap analysis
  • Role-based access and audit logs

Can be added

+ Customer-facing knowledge assistant + Product and support knowledge assistant + Additional cloud-drive sources + Custom reports + Further document automations

Who else can use this solution

These businesses have a similar document-search task, and the same solution can be adapted to their content and access rules.

A compliance organization

Task It reviews regulatory documents and compares them with reference standards.
How the solution helps The solution retrieves relevant passages, shows citations, and presents structured findings and gap analysis.

A healthcare organization

Task It searches private documents and analyzes information across regulated materials.
How the solution helps The solution combines controlled access, cited answers, document extraction, and searchable knowledge.

A business support team

Task It needs answers from private product, support, sales, or partner knowledge.
How the solution helps The solution turns organizational files into a searchable assistant with evidence-backed responses.

Technology stack

Python

Document and API processing

Python supports document extraction, processing, and application APIs.

JavaScript / TypeScript (Node.js)

Interface and retrieval services

JavaScript and TypeScript support the application interface, integrations, and retrieval services.

pymupdf

Extract PDF content

pymupdf (a Python library for extracting and processing PDFs) reads PDF content for the knowledge base.

mammoth

Read Word documents

mammoth (a library that converts DOCX files into readable HTML or Markdown) prepares Word content for search.

langchain

Connect RAG components

langchain (a toolkit for connecting language models, prompts, embeddings, and vector stores) supports retrieval-augmented answers.

pgvector

Store vector embeddings

pgvector (vector search support for PostgreSQL) stores document representations for semantic retrieval.

qdrant

Search document vectors

qdrant (a vector search engine client) retrieves passages by semantic similarity.

PDF, DOCX, XLSX, CSV

Process source files

The platform processes PDF, Word, spreadsheet, and CSV files as document sources.

Integrations

Google Drive

Google Drive supplies documents to the knowledge base through a picker or file connection.

Dropbox

Dropbox supplies private files for ingestion and retrieval.

PostgreSQL

PostgreSQL stores application records and works with pgvector for document embeddings.

The result

A searchable knowledge base keeps sources together

The first screen gives the firm one place to add private files and inspect the searchable collection. Access controls keep source visibility aligned with the firm’s rules.

The screen shows processing status for documents and connected sources.

How it works

  1. The platform receives PDF, Word, DOCX, spreadsheet, scanned, website, Google Drive, and Dropbox content.
  2. Document-processing libraries extract text and prepare source passages for ingestion.
  3. The knowledge base shows documents, source types, file types, processing status, and access controls.
  • Centralized private document collection
  • Source and file-type filters
  • Controlled access to knowledge sources
Tip: The first working version is reviewed on typical client files so rules and settings match the firm’s standards.
Knowledge base and document upload

Knowledge base and document upload

Functions on this screen
Upload Documents Ingest Workflow Documents

Cited answers make document search easier to review

The question-answering screen returns a natural-language response from the firm’s supplied documents. Citations connect the answer to source files, pages, and highlighted passages.

Chat history keeps the surrounding questions and answers available for continued research.

How it works

  1. The platform receives the user question and retrieves relevant document sections.
  2. The AI generates an answer from the retrieved sections and organizational data.
  3. The screen shows the answer with source citations, document names, page references, and highlighted passages.
  • Grounded AI answers
  • Document and page references
  • Highlighted supporting passages
Note: The answer stays connected to the source material instead of presenting an unsupported response without evidence.
Cited document question answering

Cited document question answering

Functions on this screen
AI Document Q&A Retrieve relevant document sections Source citation for answers

Retrieval status shows how document search works

The technical workspace makes ingestion and retrieval visible to the people responsible for the platform. It shows document chunks, embeddings, search results, and API status.

Semantic, vector, hybrid, or incremental search can be used according to the retrieval setup.

How it works

  1. The ingestion queue prepares document chunks and generates vector embeddings.
  2. The vector store records embeddings and returns semantic or hybrid search results.
  3. The API status shows the status of document retrieval.
  • Embedding status
  • Vector-store status
  • Search mode visibility
Semantic retrieval and embedding status

Semantic retrieval and embedding status

Functions on this screen
Generate Embeddings Store Embeddings Develop RAG pipelines

Document analysis turns passages into reviewable findings

The analysis workspace presents structured information from legal documents, including dates, parties, and obligations. It also shows risks and clauses.

The summary panel, comparison view, and gap-analysis results help the firm examine document content against reference standards.

How it works

  1. The workspace displays extracted dates, parties, obligations, risks, and clauses.
  2. The summary panel presents document summaries and the comparison view shows document content together.
  3. The gap-analysis results compare document information with reference standards.
  • Structured fields
  • Clause list
  • Comparison and gap analysis
Document analysis workspace

Document analysis workspace

Administration keeps access and activity visible

The administration screen gives the firm control over users, roles, source permissions, and platform activity. Logs, feedback, and error reports support ongoing oversight.

Usage analytics appear alongside conversation history and the audit log.

How it works

  1. The platform lists users, roles, and knowledge-source permissions.
  2. Conversation history, usage analytics, feedback, and error reports appear in the administration view.
  3. The audit log records relevant platform activity for review.
  • User and role management
  • Conversation logs
  • Audit log
Administration and usage analytics

Administration and usage analytics

What the solution gives

With this solution, the law firm can:

  • Search private legal documents with natural-language questions
  • Review answers alongside citations and highlighted passages
  • Use semantic, vector, hybrid, or incremental retrieval
  • Extract structured legal information for review
  • Compare documents with reference standards
  • Manage access, conversations, and audit activity

Could ready-made systems do the job?

Before the design, the task was compared with ready-made products by their own descriptions.

What the client needs AI legal assistants AI Legal Assistant, Harvey AI, Clio Work Legal data platforms Relativity, Rev, DISCO Platform Legal workflow systems Filevine, Eve Legal, 8am DocketWise Custom solution
Answer from supplied documents partly partly
Show traceable source citations — — —
Support semantic and hybrid search — partly —
Extract and compare document data —
Fits the client's own rules: stages, roles, reports partly partly partly
All steps in one place — — —
No manual steps between programs partly — partly

By the public descriptions of the products and their category.

The required parts exist across ready-made legal assistants, legal data platforms, and legal workflow systems. A ready-made product may be enough when only one part of the task is needed.

This client needed its own software because the document sources, citations, analysis, access rules, and retrieval methods had to fit one workflow instead of being spread across separate products. The steps between sources, search, answers, and analysis also needed a controlled connection.

In the end

In the end, the solution was made to reduce the manual work between a private legal document and a traceable answer.

FAQ

Thinking about building a similar system? These answers explain the main choices behind private document search and cited AI responses.