{"id":29739445,"url":"https://github.com/andreaschandra/kb-chatbot","last_synced_at":"2025-07-25T21:43:46.538Z","repository":{"id":301063942,"uuid":"1008049885","full_name":"andreaschandra/kb-chatbot","owner":"andreaschandra","description":"knowledge based chatbot using langchain","archived":false,"fork":false,"pushed_at":"2025-07-06T08:03:09.000Z","size":1047,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T17:20:26.684Z","etag":null,"topics":["chatbot","langchain-python","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreaschandra.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,"zenodo":null}},"created_at":"2025-06-25T00:28:05.000Z","updated_at":"2025-07-15T07:49:36.000Z","dependencies_parsed_at":"2025-06-25T01:38:13.076Z","dependency_job_id":"757969fc-5dff-4165-94f5-ca5edc5a193d","html_url":"https://github.com/andreaschandra/kb-chatbot","commit_stats":null,"previous_names":["andreaschandra/kb-chatbot"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/andreaschandra/kb-chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaschandra%2Fkb-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaschandra%2Fkb-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaschandra%2Fkb-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaschandra%2Fkb-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreaschandra","download_url":"https://codeload.github.com/andreaschandra/kb-chatbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaschandra%2Fkb-chatbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267067799,"owners_count":24030901,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chatbot","langchain-python","streamlit"],"created_at":"2025-07-25T21:43:42.620Z","updated_at":"2025-07-25T21:43:46.515Z","avatar_url":"https://github.com/andreaschandra.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 AI-Powered Knowledge Base Chatbot\n\n\u003cdiv align=\"center\"\u003e\n\n[![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://python.org)\n[![Streamlit](https://img.shields.io/badge/Streamlit-1.28+-red.svg)](https://streamlit.io)\n[![LangChain](https://img.shields.io/badge/LangChain-Latest-green.svg)](https://langchain.com)\n[![Claude](https://img.shields.io/badge/Anthropic-Claude--3.5--Haiku-purple.svg)](https://anthropic.com)\n\n*Transform your documents into an intelligent, conversational knowledge base*\n\n\u003c/div\u003e\n\n## 🚀 Overview\n\nThis **AI-Powered Knowledge Base Chatbot** revolutionizes how organizations interact with their document repositories. Built with cutting-edge AI technologies, it enables natural language conversations with your PDF and text documents, providing instant, contextual answers backed by source citations.\n\n**Perfect for:**\n\n- 📊 **Data Teams** - Query research papers, documentation, and reports\n- 🏢 **Enterprise Knowledge Management** - Centralized document intelligence\n- 🎯 **Business Intelligence** - Extract insights from company documents\n- 📚 **Research \u0026 Development** - Accelerate information discovery\n\n## ✨ Key Features\n\n### 🔍 **Intelligent Document Processing**\n\n- **Multi-format Support**: PDF and TXT document ingestion\n- **Smart Chunking**: Optimized text segmentation for better retrieval\n- **Vector Embeddings**: State-of-the-art sentence transformers for semantic search\n\n### 💬 **Conversational AI Interface**\n\n- **Natural Language Queries**: Ask questions in plain English\n- **Context-Aware Responses**: Maintains conversation history for coherent interactions\n- **Source Attribution**: Every answer includes relevant document citations\n- **Real-time Processing**: Instant responses with visual loading indicators\n\n### 🛠 **Enterprise-Ready Architecture**\n\n- **Scalable Vector Database**: ChromaDB for efficient similarity search\n- **Advanced LLM Integration**: Powered by Anthropic's Claude 3.5 Haiku\n- **Memory Management**: Conversation buffer for context retention\n- **Modular Design**: Clean separation of concerns for maintainability\n\n### 🎨 **Intuitive User Experience**\n\n- **Streamlit Interface**: Modern, responsive web application\n- **Drag-and-Drop Upload**: Effortless document management\n- **Chat History**: Persistent conversation threads\n- **Source Exploration**: Expandable source document previews\n\n## 🖥️ Interface\n\n![Knowledge Base Chatbot Demo](snapshot.png)\n\n## 🏗 Technical Architecture\n\n```\n┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐\n│   Streamlit UI  │───▶│  Document Loader │───▶│   Text Splitter │\n└─────────────────┘    └──────────────────┘    └─────────────────┘\n                                                         │\n┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐\n│   Claude 3.5    │◀───│  Retrieval Chain │◀───│  Vector Store   │\n│     Haiku       │    │   (LangChain)    │    │   (ChromaDB)    │\n└─────────────────┘    └──────────────────┘    └─────────────────┘\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Python 3.11 or higher\n- Anthropic API key\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/yourusername/kb-chatbot.git\n   cd kb-chatbot\n   ```\n\n2. **Set up Python environment**\n\n   ```bash\n   # Using uv (recommended)\n   uv sync\n   ```\n\n3. **Configure environment variables**\n\n   ```bash\n   cp .env.example .env\n   # Edit .env and add your Anthropic API key\n   echo \"ANTHROPIC_API_KEY=your_api_key_here\" \u003e\u003e .env\n   ```\n\n4. **Launch the application**\n\n   ```bash\n   streamlit run app.py\n   ```\n\n5. **Access the interface**\n   Open your browser to `http://localhost:8501`\n\n### Quick Start Guide\n\n1. **Upload Documents**: Use the sidebar to upload PDF or TXT files\n2. **Process Documents**: Click \"Process Documents\" to create the knowledge base\n3. **Start Chatting**: Ask questions about your documents in natural language\n4. **Explore Sources**: Click on source citations to view relevant document excerpts\n\n## 📋 Usage Examples\n\n### Business Intelligence Queries\n\n```\n\"What are the key performance metrics mentioned in the Q3 report?\"\n\"Summarize the main risks identified in our compliance documentation\"\n\"What budget allocations were discussed for the marketing department?\"\n```\n\n### Research \u0026 Development\n\n```\n\"What methodologies were used in the machine learning research papers?\"\n\"Compare the experimental results across different studies\"\n\"What are the limitations mentioned in the technical documentation?\"\n```\n\n### Policy \u0026 Compliance\n\n```\n\"What are the requirements for data privacy compliance?\"\n\"Summarize the employee handbook policies on remote work\"\n\"What security protocols are outlined in our IT documentation?\"\n```\n\n## 🔧 Configuration\n\n### Environment Variables\n\n```env\nANTHROPIC_API_KEY=your_anthropic_api_key\n```\n\n### Customization Options\n\n- **Chunk Size**: Modify `chunk_size` in `chatbot.py:57`\n- **Retrieval Count**: Adjust `k` parameter in `chatbot.py:65`\n- **Model Selection**: Change Claude model in `chatbot.py:26`\n\n## 🛠 Development\n\n### Project Structure\n\n```\nkb-chatbot/\n├── app.py              # Streamlit web interface\n├── chatbot.py          # Core chatbot logic\n├── pyproject.toml      # Project dependencies\n└── .env.example        # Environment template\n```\n\n### Key Components\n\n- **`KnowledgeBaseChatbot`**: Main chatbot class handling document processing and Q\u0026A\n- **Document Loaders**: PDF and text file processing utilities\n- **Vector Store**: ChromaDB integration for semantic search\n- **Conversation Chain**: LangChain orchestration for retrieval-augmented generation\n\n## 🚀 Deployment\n\n### Local Development\n\n```bash\nstreamlit run app.py\n```\n\n### Docker Deployment\n\n```bash\ndocker build -t kb-chatbot .\ndocker run -p 8501:8501 kb-chatbot\n```\n\nStill underconstruction\n\n### Cloud Deployment\n\nCompatible with:\n\n- Streamlit Cloud\n- AWS EC2/ECS\n- Google Cloud Run\n- Azure Container Instances\n\n## 🤝 Contributing\n\nContributions are welcomed!\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **Anthropic** for Claude 3.5 Haiku LLM\n- **LangChain** for the RAG framework\n- **LangGraph** for the RAG framework\n- **Streamlit** for the web interface\n- **ChromaDB** for vector storage\n- **Hugging Face** for embedding models\n\n## 📞 Support\n\n- 📧 Discord: andreaschandra#4851\n- 💬 Issues: [GitHub Issues](https://github.com/andreaschandra/kb-chatbot/issues)\n- 📖 Documentation: [Wiki](https://github.com/andreaschandra/kb-chatbot/wiki)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built with ❤️ for intelligent document interaction**\n\n[⭐ Star this repository](https://github.com/andreaschandra/kb-chatbot) if you find it helpful!\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaschandra%2Fkb-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreaschandra%2Fkb-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaschandra%2Fkb-chatbot/lists"}