Skip to content

Repository files navigation

Local Doc Scanner

AI-Powered Document Q&A System

A completely offline, privacy-preserving document search and question-answering system using vector embeddings, local LLMs, and Microsoft Agent Framework.

.NETPostgreSQLOllamaLicense


Features

  • Completely Offline - All processing runs locally, no internet required after initial setup
  • Microsoft Agent Framework - Built on Microsoft.Agents.AI.Foundry for AI orchestration
  • Fast Search - Vector indexing for quick similarity search
  • AI-Powered - Local LLM integration for accurate, context-aware answers
  • Multi-Format - Support for .txt, .json, and .pdf files
  • Context-Aware Search - Uses document context for better answers
  • Audit Logs - Track all queries with detailed metrics
  • Modern UI - Clean, responsive interface built with Bootstrap 5

Screenshots

Landing PageUpload Docs PageQuery Docs PageSearch Results - Passed
Landing PageUpload DocumentsQuery DocumentsSearch Results - Success
Search Results - FailedAudit Logs PageRescan Docs Page
Search Results - FailedAudit LogsRescan Documents

Click on any thumbnail to view full-size image

Quick Start

# 1. Install PostgreSQL with pgvector extension# 2. Install Ollama and pull models
ollama pull nomic-embed-text:latest
ollama pull llama3.2:3b
# 3. Run backendcd LocalDocScannerBE
dotnet run --configuration Release
# 4. In another terminal, run frontendcd LocalDocScannerUI
dotnet run --configuration Release
# 5. Open https://localhost:7106

Additional Documentation

DocumentDescription
ARCHITECTURE.mdSystem design & architecture
IMPLEMENTATION_SUMMARY.mdTechnical overview
VECTOR_DEBUGGING.mdVector features & troubleshooting
DEPLOYMENT_CHECKLIST.mdProduction deployment guide

Architecture

graph TD
UI[User Interface] --> API[ASP.NET Core API]
API --> Upload[Document Upload]
API --> Query[Query Processing]
Upload --> PG[(PostgreSQL)]
Query --> Search[Vector Search]
Search --> PG
PG --> Search
Search --> Query
Query --> Ollama[Ollama LLM]
Ollama --> Query
Query --> PG
Loading

System Requirements

  • PostgreSQL with pgvector extension
  • Ollama for local LLM inference
  • .NET 10 SDK - For running the application
  • 4GB+ RAM - For running Ollama models (8GB+ recommended)
  • 10GB+ Disk - For model storage and documents
  • Ports: 5432 (DB), 11434 (Ollama), 7106 (Frontend), 7126 (Backend)

Performance

OperationTime
Upload 3 documents15-30s
First query20-30s
Subsequent query5-10s
Vector search<50ms

Times vary based on content length and hardware

Configuration

Models

  • Embedding: nomic-embed-text:latest (384-dim, fast)
  • Generation: llama3.2:3b (3B params, lightweight)

Database

  • PostgreSQL with pgvector extension
  • IVFFlat index for fast vector search

Troubleshooting

Scaling

Current (Single Machine)

  • Up to 10,000 documents
  • 50 concurrent users
  • 100 queries/min

Future (Horizontal Scaling)

  • Multiple backend instances
  • Managed database service (AWS RDS, Azure)
  • Load balancer
  • Caching layer

See DEPLOYMENT_CHECKLIST.md for details

Security

  • Local inference (no external API calls)
  • Runs on localhost by default
  • No internet required for operation
  • Full data privacy

For production deployment, see DEPLOYMENT_CHECKLIST.md

Technology Stack

ComponentTechnology
BackendASP.NET Core 10, C# 14
FrontendASP.NET Core MVC, Bootstrap 5
AI FrameworkMicrosoft Agent Framework (Microsoft.Agents.AI.Foundry)
LLMOllama (local inference)
DatabasePostgreSQL + pgvector
IndexingIVFFlat

How It Works

  1. Upload Documents - Upload .txt, .json, or .pdf files
  2. Generate Embeddings - Automatically converts documents to semantic vectors
  3. Semantic Search - Finds relevant documents using vector similarity
  4. Answer Questions - Uses context from documents to answer queries

Implementation Status

Complete & Tested

  • Microsoft Agent Framework integration
  • Ollama integration
  • Vector embedding generation
  • pgvector semantic search
  • Context-aware query processing
  • Document processing
  • API endpoints
  • UI components
  • Complete documentation

Next Steps

  1. Install - Follow quick-start instructions above
  2. Deploy - Follow DEPLOYMENT_CHECKLIST.md
  3. Monitor - Check daily health metrics
  4. Scale - Refer to scaling guide as needed

Support

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments


Status: Production Ready
Version: 1.0
Last Updated: April 2026

Get started now: Follow the Quick Start instructions above

Made by Nhilesh Baua

Disclaimer

This documentation is automatically generated and may not reflect the recent state of the project. Changes in the codebase may not be immediately reflected in this documentation.

About

A local document scanning and AI-powered query system using semantic search and embeddings.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages