-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): Add .venv* to .gitignore, create CODE_OF_CONDUCT.md and …
…CONTRIBUTING.md, and update README.md with detailed project information and features
- Loading branch information
1 parent
2cf7f7e
commit 9b62430
Showing
4 changed files
with
382 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our community include: | ||
|
||
- Demonstrating empathy and kindness toward other people | ||
- Being respectful of differing opinions, viewpoints, and experiences | ||
- Giving and gracefully accepting constructive feedback | ||
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience | ||
- Focusing on what is best not just for us as individuals, but for the overall community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
- The use of sexualized language or imagery, and sexual attention or advances of any kind | ||
- Trolling, insulting or derogatory comments, and personal or political attacks | ||
- Public or private harassment | ||
- Publishing others' private information, such as a physical or email address, without their explicit permission | ||
- Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series of actions. | ||
|
||
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within the community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). | ||
|
||
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Contributing to DocMind AI | ||
|
||
Thank you for your interest in contributing to DocMind AI! We appreciate your help in making this project even better. | ||
|
||
## Ways to Contribute | ||
|
||
- **Report Bugs:** Submit detailed bug reports with steps to reproduce the issue. | ||
- **Suggest Enhancements:** Propose new features or improvements. | ||
- **Improve Documentation:** Help us make the documentation clearer and more comprehensive. | ||
- **Submit Code:** Contribute code by fixing bugs, implementing new features, or improving existing code. | ||
|
||
## How to Submit a Pull Request | ||
|
||
1. **Fork the repository** to your own GitHub account. | ||
2. **Clone the forked repository** to your local machine: | ||
|
||
```bash | ||
git clone https://github.com/BjornMelin/docmind-ai.git | ||
cd docmind-ai | ||
``` | ||
|
||
3. **Create a new branch** for your changes: | ||
|
||
```bash | ||
git checkout -b feature/your-feature-name | ||
``` | ||
|
||
(Replace `feature/your-feature-name` with a descriptive branch name, such as `fix/bug-description` or `feat/new-feature-name`) | ||
|
||
4. **Make your changes** to the code or documentation. | ||
5. **Commit your changes** with clear and concise commit messages: | ||
|
||
```bash | ||
git commit -m "Fix: Resolve issue with PDF loading" | ||
``` | ||
|
||
6. **Push your branch** to your forked repository: | ||
|
||
```bash | ||
git push origin feature/your-feature-name | ||
``` | ||
|
||
7. **Create a Pull Request (PR):** | ||
- Go to the original DocMind AI repository on GitHub. | ||
- Click the "New Pull Request" button. | ||
- Select your forked repository and the branch you just pushed. | ||
- Provide a clear and descriptive title and detailed description of your changes in the PR. | ||
- Submit the pull request. | ||
|
||
## Development Guidelines | ||
|
||
- Follow the existing coding style and conventions used in the project. | ||
- Write clear and concise commit messages. | ||
- Thoroughly test your changes before submitting a PR. | ||
- Document your code appropriately. | ||
- Keep your PRs focused on a single issue or feature. | ||
|
||
## Code of Conduct | ||
|
||
Please note that this project has a [Code of Conduct](CODE_OF_CONDUCT.md). We expect all contributors to adhere to it. | ||
|
||
We appreciate your contributions and look forward to reviewing your pull requests! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,238 @@ | ||
# docmind-ai | ||
DocMind AI is a powerful, open-source Streamlit application leveraging LangChain and local Large Language Models (LLMs) via Ollama for advanced document analysis. Analyze, summarize, and extract insights from a wide array of file formats—securely and privately, all offline. | ||
# 🧠 DocMind AI: Local LLM for AI-Powered Document Analysis | ||
|
||
![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white) | ||
![Streamlit](https://img.shields.io/badge/Streamlit-FF4B4B?style=for-the-badge&logo=streamlit&logoColor=white) | ||
![LangChain](https://img.shields.io/badge/🦜_LangChain-2C2C2C?style=for-the-badge) | ||
![Docker](https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white) | ||
![Ollama](https://img.shields.io/badge/🦙_Ollama-000000?style=for-the-badge) | ||
|
||
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/) | ||
[![GitHub](https://img.shields.io/badge/GitHub-BjornMelin-181717?logo=github)](https://github.com/BjornMelin) | ||
[![LinkedIn](https://img.shields.io/badge/LinkedIn-Bjorn%20Melin-0077B5?logo=linkedin)](https://www.linkedin.com/in/bjorn-melin/) | ||
|
||
**DocMind AI** is a powerful, open-source Streamlit application that leverages the capabilities of Large Language Models (LLMs) running locally on your machine through [Ollama](https://ollama.com/). Analyze a vast array of document types, extract key insights, generate summaries, identify action items, and surface open questions – all without sending your data to the cloud! | ||
|
||
## ✨ Features of DocMind AI | ||
|
||
- **Privacy-Focused:** Your documents are processed locally, ensuring data privacy and security. | ||
- **Versatile Document Handling:** Supports a wide range of file formats: | ||
- 📑 DOCX | ||
- 📝 TXT | ||
- 📊 XLSX | ||
- 🌐 MD (Markdown) | ||
- 🗃️ JSON | ||
- 🗂️ XML | ||
- 🔤 RTF | ||
- 📇 CSV | ||
- 📧 MSG (Email) | ||
- 🖥️ PPTX (PowerPoint) | ||
- 📘 ODT (OpenDocument Text) | ||
- 📚 EPUB (E-book) | ||
- 💻 Code files (PY, JS, JAVA, TS, TSX, C, CPP, H, and more!) | ||
- **Powerful AI Analysis:** Uses the power of LangChain to provide in-depth analysis. | ||
- **Structured Output:** Get results in a well-defined format using Pydantic. | ||
- **Customizable Prompts:** Tailor the analysis to your specific needs with pre-defined or custom prompts. | ||
- **Tone and Instruction Control:** Fine-tune the LLM's responses by selecting the desired tone (e.g., professional, informal, academic) and specific instructions (e.g., act as a researcher, software engineer, business analyst). | ||
- **Length/Detail Selection:** Control the length and level of detail of the generated responses (e.g., concise, detailed, comprehensive). | ||
- **Flexible Analysis Modes:** Choose to analyze each document individually or combine them for a holistic analysis. | ||
- **Interactive Chat:** Continue the conversation with the LLM to explore the documents further. | ||
- **Docker Support:** Easily deploy the application using Docker or Docker Compose. | ||
|
||
## 📖 Table of Contents | ||
|
||
1. [Features of DocMind AI](#-features-of-docmind-ai) | ||
2. [Getting Started with DocMind AI: Local LLM Analysis](#-getting-started-with-docmind-ai-local-llm-analysis) | ||
- [Prerequisites](#-prerequisites) | ||
- [Installation](#️-installation) | ||
- [Running the App](#️-running-the-app) | ||
3. [Usage](#-usage) | ||
- [Selecting a Model](#️-selecting-a-model) | ||
- [Uploading Documents](#-uploading-documents) | ||
- [Choosing Prompts](#️-choosing-prompts) | ||
- [Selecting Tone](#-selecting-tone) | ||
- [Selecting Instructions](#-selecting-instructions) | ||
- [Setting Length/Detail](#-setting-lengthdetail) | ||
- [Choosing Analysis Mode](#️-choosing-analysis-mode) | ||
- [Analyzing Documents](#-analyzing-documents) | ||
- [Interacting with the LLM](#-interacting-with-the-llm) | ||
4. [Architecture](#️-architecture) | ||
5. [How to Cite](#-how-to-cite) | ||
6. [Contributing](#-contributing) | ||
7. [License](#-license) | ||
|
||
## 🚀 Getting Started with DocMind AI: Local LLM Analysis | ||
|
||
### 📋 Prerequisites | ||
|
||
- [Ollama](https://ollama.com/) installed and running. | ||
- Python 3.8 or higher. | ||
- (Optional) Docker and Docker Compose for containerized deployment. | ||
|
||
### ⚙️ Installation | ||
|
||
1. **Clone the repository:** | ||
|
||
```bash | ||
git clone https://github.com/BjornMelin/docmind-ai.git | ||
cd docmind-ai | ||
``` | ||
|
||
2. **Install dependencies:** | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
### ▶️ Running the App | ||
|
||
**Locally:** | ||
|
||
```bash | ||
streamlit run app.py | ||
``` | ||
|
||
**With Docker:** | ||
|
||
```bash | ||
docker-compose up --build | ||
``` | ||
|
||
The app will be accessible at `http://localhost:8501`. | ||
|
||
## 💻 Usage | ||
|
||
### 🎛️ Selecting a Model | ||
|
||
1. Enter the **Ollama Base URL** (default: `http://localhost:11434`). | ||
2. Choose your desired **Ollama Model Name** (e.g., `llama2`) from the dropdown. | ||
|
||
### 📁 Uploading Documents | ||
|
||
Click the **"Browse files"** button to upload one or more documents. Supported file types are listed above in the [Features](#-features) section. | ||
|
||
### ✍️ Choosing Prompts | ||
|
||
Select a pre-defined prompt from the dropdown: | ||
|
||
- **Comprehensive Document Analysis:** Get a summary, key insights, action items, and open questions. | ||
- **Extract Key Insights and Action Items:** Focus on extracting these two elements. | ||
- **Summarize and Identify Open Questions:** Generate a summary and a list of open questions. | ||
- **Custom Prompt:** Enter your own prompt to guide the analysis. | ||
|
||
### 😃 Selecting Tone | ||
|
||
Choose the desired tone for the LLM's response: | ||
|
||
- **Professional:** Objective and formal. | ||
- **Academic:** Scholarly and research-oriented. | ||
- **Informal:** Casual and conversational. | ||
- **Creative:** Imaginative and artistic. | ||
- **Neutral:** Unbiased and objective. | ||
- **Direct:** Concise and to-the-point. | ||
- **Empathetic:** Understanding and compassionate. | ||
- **Humorous:** Witty and lighthearted. | ||
- **Authoritative:** Confident and expert. | ||
- **Inquisitive:** Curious and exploratory. | ||
|
||
### 🧮 Selecting Instructions | ||
|
||
Select the persona or instructions that the LLM should follow: | ||
|
||
- **General Assistant:** Act as a helpful assistant. | ||
- **Researcher:** Provide in-depth research and analysis. | ||
- **Software Engineer:** Focus on technical details and code. | ||
- **Product Manager:** Consider product strategy and user experience. | ||
- **Data Scientist:** Emphasize data analysis and modeling. | ||
- **Business Analyst:** Analyze from a business and strategic perspective. | ||
- **Technical Writer:** Create clear and concise documentation. | ||
- **Marketing Specialist:** Focus on branding and customer engagement. | ||
- **HR Manager:** Consider human resources aspects. | ||
- **Legal Advisor:** Provide information from a legal standpoint. | ||
- **Custom Instructions:** Enter your own specific instructions. | ||
|
||
### 📏 Setting Length/Detail | ||
|
||
Choose the desired length and level of detail for the LLM's response: | ||
|
||
- **Concise:** Brief and to-the-point. | ||
- **Detailed:** Thorough and comprehensive. | ||
- **Comprehensive:** Extensive and in-depth. | ||
- **Bullet Points:** Provide response in bullet point format. | ||
|
||
### 🗂️ Choosing Analysis Mode | ||
|
||
Select the analysis mode: | ||
|
||
- **Analyze each document separately:** Process and analyze each document individually. | ||
- **Combine analysis for all documents:** Treat all uploaded documents as a single unit for analysis. | ||
|
||
### 🧠 Analyzing Documents | ||
|
||
1. Upload your documents. | ||
2. Choose your analysis prompt, tone, instructions, desired length, and analysis mode. | ||
3. Click the **"Extract and Analyze"** button. | ||
|
||
The application will display the analysis results, attempting to format them according to the defined output schema. If parsing fails, the raw LLM output will be shown. | ||
|
||
### 💬 Interacting with the LLM | ||
|
||
Use the chat interface to ask follow-up questions about the analyzed documents. The LLM will use the extracted information as context for its responses. | ||
|
||
## 🏗️ Architecture | ||
|
||
Here's a Mermaid diagram illustrating the application's architecture: | ||
|
||
```mermaid | ||
graph TD | ||
A[User] -->|Uploads Documents| B(Streamlit App - app.py); | ||
B -->|Selects Model, Prompt, Tone, Instructions, Length, Mode| C{Ollama API}; | ||
C -->|Processes Documents| D[LangChain]; | ||
D -->|Loads Documents| E{Document Loaders}; | ||
E -->|PDF| F[PyPDFLoader]; | ||
E -->|DOCX| G[Docx2Loader]; | ||
E -->|TXT, Code| H[TextLoader]; | ||
E -->|...| I; | ||
D -->|Splits Text| J[RecursiveCharacterTextSplitter]; | ||
D -->|Generates Analysis| K[LLM - Ollama Model]; | ||
K -->|Structured Output| L[PydanticOutputParser]; | ||
B -->|Displays Results| A; | ||
A -->|Asks Follow-up Questions| B; | ||
B -->|Interacts with LLM| C; | ||
style A fill:#f9f,stroke:#333,stroke-width:2px | ||
style B fill:#ccf,stroke:#333,stroke-width:2px | ||
style C fill:#cfc,stroke:#333,stroke-width:2px | ||
style D fill:#fcc,stroke:#333,stroke-width:2px | ||
style K fill:#ccf,stroke:#333,stroke-width:2px | ||
``` | ||
|
||
## 📖 How to Cite | ||
|
||
If you use DocMind AI in your research or work, please cite it as follows: | ||
|
||
```bibtex | ||
@software{melin_docmind_ai_2025, | ||
author = {Melin, Bjorn}, | ||
title = {DocMind AI: Local LLM for AI-Powered Document Analysis}, | ||
url = {https://github.com/BjornMelin/docmind-ai}, | ||
version = {0.1.0}, | ||
year = {2025} | ||
} | ||
``` | ||
|
||
## 🙌 Contributing | ||
|
||
We welcome contributions! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for details on how to contribute to this project. | ||
|
||
## 📃 License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
|
||
--- | ||
|
||
<div align="center"> | ||
|
||
Built with ❤️ by [Bjorn Melin](https://bjornmelin.io) | ||
|
||
</div> |