Skip to content

A simple FastAPI application that allows users to upload PDF or DOCX documents in a database, get a summary generated by a local LLM via Ollama, and ask natural language questions about their content.

Notifications You must be signed in to change notification settings

athallahaiqal/document-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 Document AI

Document AI

Welcome to the Document AI repository! This project is a simple FastAPI application that allows users to upload PDF or DOCX documents to a database. It generates summaries using a local LLM via Ollama and enables users to ask natural language questions about their content.

Check out the latest releases here!

🚀 Features

  • Upload Documents: Easily upload PDF or DOCX files.
  • Summarization: Get concise summaries generated by a local LLM.
  • Natural Language Queries: Ask questions about your documents in plain language.
  • Database Storage: Store your documents securely in a database.
  • User-Friendly Interface: Simple and intuitive design for a smooth user experience.

📚 Table of Contents

🛠️ Installation

To get started with Document AI, follow these steps:

  1. Clone the repository:

    git clone https://github.com/athallahaiqal/document-ai.git
    cd document-ai
  2. Set up a virtual environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required packages:

    pip install -r requirements.txt
  4. Run the application:

    uvicorn main:app --reload

Now, you can access the application at http://127.0.0.1:8000.

🖥️ Usage

Once the application is running, you can:

  1. Upload your documents: Use the provided interface to upload PDF or DOCX files.
  2. Get summaries: After uploading, click on the "Generate Summary" button to receive a concise overview of your document.
  3. Ask questions: Use the input field to type your questions regarding the document's content. The system will respond with relevant answers.

🛠️ Technologies Used

This project utilizes the following technologies:

  • FastAPI: A modern web framework for building APIs with Python 3.6+ based on standard Python type hints.
  • Ollama: A local LLM that generates summaries and answers questions.
  • Alembic: A lightweight database migration tool for use with SQLAlchemy.
  • SQLAlchemy: A SQL toolkit and Object-Relational Mapping (ORM) system for Python.
  • Pydantic: Data validation and settings management using Python type annotations.
  • Ruff: A fast Python linter and code formatter.
  • Docker: To containerize the application for easy deployment.

🧑‍🤝‍🧑 Contributing

We welcome contributions! If you want to help improve Document AI, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your branch to your forked repository.
  5. Open a pull request with a clear description of your changes.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

📬 Contact

For any questions or suggestions, feel free to reach out:

For updates, visit our Releases section.


Thank you for checking out Document AI! We hope you find it useful for your document processing needs.