An open API service indexing awesome lists of open source software.

https://github.com/degisew/legal-assistant

An AI application that lets users upload documents and chat with them using natural language.
https://github.com/degisew/legal-assistant

ai fastapi langchain llm pineconedb postgressql python3 rag

Last synced: about 1 month ago
JSON representation

An AI application that lets users upload documents and chat with them using natural language.

Awesome Lists containing this project

README

          

# Legal Assistant

[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/Python-3.12+-blue.svg)](https://python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.115+-brightgreen.svg)](https://fastapi.tiangolo.com)
[![Langchain](https://img.shields.io/badge/Langchain-3.0+-green.svg)](https://www.langchain.com/)

**Contact**: [degisew.mengist21@gmail.com](mailto:degisew.mengist21@gmail.com) | [LinkedIn](https://linkedin.com/in/degisew-mengist)

## Overview

An AI application that lets users upload documents and chat with them using natural language. Whether it's legal agreements, contracts, or internal company docs, just upload and ask questions like you're chatting with a human expert.

**Key Features**:

- Upload documents in multiple formats (PDF, DOCX, Markdown)

- Chat interface with intelligent, context-aware answers

- Secure login & document management

- Chat history per document

## [Check Front-end code here](https://github.com/degisew/legal_assistant_ui)

## Table of Contents

- [Overview](#overview)
- [Setup](#setup)
- [Architecture](#architecture)

## Setup

Show Setup Details

### Prerequisites

- Python 3.10+
- uv 0.7+
- Langchain 3+
- Git 2.30+

### Instructions

1. **Clone the Repository**:

```bash
git clone https://github.com/degisew/RAG.git
cd RAG
```

2. **Configure Environment**:

```bash
Create a .env file with-in your root project directory and store secure values.
```

Example `.env`:

```bash
# API Keys
LANGSMITH_API_KEY=your_key
GROQ_API_KEY=your_key
```

- **Local Development**:

```bash
# lInstall uv
curl -Ls https://astral.sh/uv/install.sh | sh

# If you have pipx installed n your system,
pipx install uv

# create virtual environment
uv venv # Creates a virtual environment
uv pip sync # Installs dependencies from pyproject.toml

fastapi dev main.py # run the flask app
```

**Access API Docs**: [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)

## Architecture
rag_app_architecture

**Tech Stack**:

- **Frontend:** React + TypeScript + CSS
- **Backend:** FastAPI
- **SQL Database:** PostgreSQL
- **Vector DB:** Pinecone
- **LLM Support:** Groq + HuggingFace transformers

## License

MIT License. See [LICENSE](LICENSE).

**⭐ Star this repo if you found it useful!**

Built by [Degisew Mengist](https://github.com/degisew)

[⬆ Back to Top](#legal-assistant)