{"id":25214016,"url":"https://github.com/pranshu936/chatbot","last_synced_at":"2025-07-26T22:33:59.597Z","repository":{"id":276208081,"uuid":"928575294","full_name":"Pranshu936/Chatbot","owner":"Pranshu936","description":"This Legal Assistant Chatbot is an AI-powered application designed to assist with legal research and documentation. It leverages advanced language models and a comprehensive legal knowledge base to provide accurate and relevant information to users' legal queries.","archived":false,"fork":false,"pushed_at":"2025-02-06T21:40:45.000Z","size":14295,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T16:47:52.286Z","etag":null,"topics":["fastapi","huggingface","python","rag","streamlit","vector-database"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pranshu936.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-06T21:24:11.000Z","updated_at":"2025-05-28T13:17:56.000Z","dependencies_parsed_at":"2025-02-06T22:39:32.880Z","dependency_job_id":null,"html_url":"https://github.com/Pranshu936/Chatbot","commit_stats":null,"previous_names":["pranshu936/chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pranshu936/Chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranshu936%2FChatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranshu936%2FChatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranshu936%2FChatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranshu936%2FChatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pranshu936","download_url":"https://codeload.github.com/Pranshu936/Chatbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranshu936%2FChatbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262864118,"owners_count":23376455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","huggingface","python","rag","streamlit","vector-database"],"created_at":"2025-02-10T16:58:14.824Z","updated_at":"2025-06-30T23:04:02.656Z","avatar_url":"https://github.com/Pranshu936.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Legal Assistant Chatbot\n\n## Overview\n\nThis Legal Assistant Chatbot is an AI-powered application designed to assist with legal research and documentation. It leverages advanced language models and a comprehensive legal knowledge base to provide accurate and relevant information to users' legal queries.\n\n## Features\n\n- **AI-Powered Responses**: Utilizes the Mistral-7B-Instruct-v0.3 model for generating human-like responses to legal questions.\n- **Vector Store Integration**: Employs FAISS for efficient retrieval of relevant legal information.\n- **User-Friendly Interface**: Built with Streamlit for an intuitive and responsive user experience.\n- **Customizable Settings**: Allows users to adjust response creativity and length.\n- **Source Attribution**: Provides sources for the information used in responses.\n- **PDF and JSONL Document Processing**: Ingests and processes both PDF and JSONL files for comprehensive knowledge base creation.\n\n## Technical Stack\n\n- **Frontend**: Streamlit\n- **Backend**: FastAPI\n- **Language Model**: HuggingFace's Mistral-7B-Instruct-v0.3\n- **Embeddings**: sentence-transformers/all-MiniLM-L6-v2\n- **Vector Store**: FAISS\n- **Language**: Python\n\n## Project Structure\n\n```\npranshu936-chatbot/\n├── README.md\n└── lawchatbot/\n    ├── connect_memory_with_llm.py\n    ├── create_memory_for_chatbot.py\n    ├── lawchatbot.py\n    ├── chatbot/\n    │   ├── app.py\n    │   ├── api/\n    │   │   └── main.py\n    │   └── data/\n    │       └── data.jsonl\n    └── data/\n        └── data.jsonl\n```\n\n## Setup and Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/pranshu936-chatbot.git\n   cd pranshu936-chatbot\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Set up environment variables:\n   Create a `.env` file in the root directory and add:\n   ```\n   HF_TOKEN=your_huggingface_token\n   ```\n\n## Usage\n\n1. Create the vector store:\n   ```bash\n   python lawchatbot/create_memory_for_chatbot.py\n   ```\n\n2. Start the FastAPI backend:\n   ```bash\n   uvicorn lawchatbot.chatbot.api.main:app --reload\n   ```\n\n3. Launch the Streamlit frontend:\n   ```bash\n   streamlit run lawchatbot/chatbot/app.py\n   ```\n\n4. Open your browser and navigate to the provided local URL.\n\n5. Interact with the chatbot by typing your legal questions in the chat input.\n\n## Key Components\n\n### Vector Store Creation (`create_memory_for_chatbot.py`)\n\n- Loads PDF and JSONL files from specified directories.\n- Processes and chunks the documents for efficient storage.\n- Creates and saves a FAISS vector store with the processed data.\n\n### LLM Integration (`connect_memory_with_llm.py`)\n\n- Sets up the connection between the vector store and the language model.\n- Configures the RetrievalQA chain for question answering.\n\n### Main Application (`lawchatbot.py`)\n\n- Implements the core chatbot functionality.\n- Manages the user interface and interaction flow.\n\n### API Backend (`chatbot/api/main.py`)\n\n- Provides a FastAPI backend for handling queries.\n- Integrates with the LLM and vector store for processing requests.\n\n### Streamlit Frontend (`chatbot/app.py`)\n\n- Offers a user-friendly web interface for interacting with the chatbot.\n- Communicates with the backend API to process user queries.\n\n## Customization\n\nThe chatbot's behavior can be customized by adjusting parameters such as:\n\n- Temperature (controls response creativity)\n- Max length (determines the maximum length of responses)\n- Number of retrieved documents (k value in vector store retrieval)\n\nThese settings can be modified in the respective Python files or through the Streamlit interface.\n\n## Contributing\n\nContributions to improve the chatbot are welcome. Please feel free to submit pull requests or open issues for any bugs or feature requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranshu936%2Fchatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpranshu936%2Fchatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranshu936%2Fchatbot/lists"}