|
| 1 | +# RAG-Dokumenten-Chatbot (PoC) |
| 2 | + |
| 3 | +[](./LICENSE) |
| 4 | +[](https://github.com/vibtellect/rag-document-chatbot) |
| 5 | + |
| 6 | +DE-first README. English version: [README_EN.md](./README_EN.md) |
| 7 | + |
| 8 | +## 3-Minuten-Ergebnis |
| 9 | + |
| 10 | +Diese Demo liefert einen lauffaehigen RAG-Stack fuer Unternehmensdokumente: |
| 11 | + |
| 12 | +`PDF/Markdown Upload -> Chunking + Embeddings -> Qdrant -> Quellenbasierte Antwort` |
| 13 | + |
| 14 | +**Proof-of-Concept**: Schnell einsatzbereit, ideal zum Lernen und Experimentieren. Fuer produktiven Einsatz siehe [Naechste Schritte](#naechste-schritte). |
| 15 | + |
| 16 | +## Problem |
| 17 | + |
| 18 | +Wissen steckt in vielen internen Dokumenten und ist schwer auffindbar. |
| 19 | + |
| 20 | +## Loesung |
| 21 | + |
| 22 | +Ein FastAPI-Backend mit Qdrant und Bedrock beantwortet Fragen auf Basis hochgeladener Inhalte, inkl. Quellenhinweisen. |
| 23 | + |
| 24 | +## Architektur |
| 25 | + |
| 26 | +- **Frontend**: React + Vite (Web-UI fuer Upload + Chat) |
| 27 | +- **Backend**: FastAPI (Ingestion, Retrieval, LLM-Integration) |
| 28 | +- **Vector Store**: Qdrant (In-Memory oder persistent) |
| 29 | +- **Modelle**: AWS Bedrock (Claude 3.5 Sonnet + Titan Embeddings) |
| 30 | +- **Containerisierung**: Docker Compose |
| 31 | + |
| 32 | +## Quickstart |
| 33 | + |
| 34 | +### 1) Setup |
| 35 | + |
| 36 | +```bash |
| 37 | +make setup |
| 38 | +``` |
| 39 | + |
| 40 | +Dann `.env` aus `.env.example` kopieren und fuellen: |
| 41 | + |
| 42 | +```bash |
| 43 | +AWS_ACCESS_KEY_ID=AKIAXXXXXXXXXXXXXXXX |
| 44 | +AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 45 | +AWS_REGION=eu-central-1 |
| 46 | +``` |
| 47 | + |
| 48 | +### 2) Start (Docker Compose) |
| 49 | + |
| 50 | +```bash |
| 51 | +make up |
| 52 | +``` |
| 53 | + |
| 54 | +Frontend erreichbar unter `http://localhost:3000`, API unter `http://localhost:8000`. |
| 55 | + |
| 56 | +### 3) Smoke-Test |
| 57 | + |
| 58 | +```bash |
| 59 | +make smoke |
| 60 | +``` |
| 61 | + |
| 62 | +Erwartung: |
| 63 | +- API Health `http://localhost:8000/health` erreichbar |
| 64 | +- Frontend `http://localhost:3000` erreichbar |
| 65 | + |
| 66 | +### 4) Stop |
| 67 | + |
| 68 | +```bash |
| 69 | +make down |
| 70 | +``` |
| 71 | + |
| 72 | +## Demo-Nutzung {#demo} |
| 73 | + |
| 74 | +### 1) Demo-Dokumente hochladen |
| 75 | + |
| 76 | +5 Unternehmensdokumente stehen in `demo-docs/` bereit: |
| 77 | + |
| 78 | +```bash |
| 79 | +# Alle Demo-Dokumente hochladen |
| 80 | +for doc in demo-docs/*.md; do |
| 81 | + curl -X POST http://localhost:8000/api/upload \ |
| 82 | + -F "file=@$doc" -F "tenant_id=demo" |
| 83 | +done |
| 84 | +``` |
| 85 | + |
| 86 | +### 2) Fragen stellen (cURL) |
| 87 | + |
| 88 | +```bash |
| 89 | +# IT-Sicherheit |
| 90 | +curl -X POST http://localhost:8000/api/ask \ |
| 91 | + -H "Content-Type: application/json" \ |
| 92 | + -d '{"question": "Wie viele Zeichen muss ein Passwort mindestens haben?", "tenant_id": "demo"}' |
| 93 | + |
| 94 | +# Reisekosten |
| 95 | +curl -X POST http://localhost:8000/api/ask \ |
| 96 | + -H "Content-Type: application/json" \ |
| 97 | + -d '{"question": "Wie hoch ist die Hotelkostenpauschale in Muenchen?", "tenant_id": "demo"}' |
| 98 | + |
| 99 | +# Homeoffice |
| 100 | +curl -X POST http://localhost:8000/api/ask \ |
| 101 | + -H "Content-Type: application/json" \ |
| 102 | + -d '{"question": "Wie viele Tage pro Woche darf ich im Homeoffice arbeiten?", "tenant_id": "demo"}' |
| 103 | + |
| 104 | +# Onboarding |
| 105 | +curl -X POST http://localhost:8000/api/ask \ |
| 106 | + -H "Content-Type: application/json" \ |
| 107 | + -d '{"question": "Was muss ich in der ersten Woche als neuer Mitarbeiter erledigen?", "tenant_id": "demo"}' |
| 108 | +``` |
| 109 | + |
| 110 | +### 3) UI-basiert |
| 111 | + |
| 112 | +Frontend unter `http://localhost:3000` oeffnen: |
| 113 | +1. Documents hochladen (Drag-and-Drop oder Button) |
| 114 | +2. Fragen stellen im Chat-Interface |
| 115 | +3. Quellen anzeigen und validieren |
| 116 | + |
| 117 | +## API-Endpunkte |
| 118 | + |
| 119 | +- `POST /api/upload` (PDF oder Markdown) |
| 120 | +- `POST /api/ask` |
| 121 | +- `GET /api/documents` |
| 122 | +- `DELETE /api/documents/{doc_id}` |
| 123 | +- `GET /health` |
| 124 | + |
| 125 | +## Projektstruktur |
| 126 | + |
| 127 | +```text |
| 128 | +. |
| 129 | +|-- Makefile |
| 130 | +|-- docker-compose.yml |
| 131 | +|-- .env.example |
| 132 | +|-- backend/ |
| 133 | +|-- frontend/ |
| 134 | +`-- demo-docs/ |
| 135 | + |-- it-sicherheitsrichtlinie.md |
| 136 | + |-- urlaubsregelung.md |
| 137 | + |-- onboarding-checkliste.md |
| 138 | + |-- reisekostenrichtlinie.md |
| 139 | + `-- homeoffice-regelung.md |
| 140 | +``` |
| 141 | + |
| 142 | +## Kosten (Richtwert) |
| 143 | + |
| 144 | +Abhaengig von Tokenvolumen und Dokumentmenge, typischerweise im niedrigen zweistelligen USD-Bereich fuer kleine PoCs. |
| 145 | + |
| 146 | +Bedrock-Pricing: https://aws.amazon.com/de/bedrock/pricing/ |
| 147 | + |
| 148 | +## Grenzen des PoC |
| 149 | + |
| 150 | +- Kein Auth-/Rechtemodell |
| 151 | +- Kein Langzeit-Monitoring/Observability |
| 152 | +- Retrieval-Strategie ist bewusst einfach gehalten |
| 153 | +- Nicht fuer direkten Produktivbetrieb ausgelegt |
| 154 | + |
| 155 | +## Naechste Schritte fuer Produktivbetrieb |
| 156 | + |
| 157 | +1. **Sicherheit**: Secret Management, Authentifizierung/Autorisierung, TLS |
| 158 | +2. **Retrieval**: Reranking, Hybrid Search, Query-Expansion |
| 159 | +3. **Betriebsbetrieb**: Logging, Monitoring, Alerting, Datenhaltung |
| 160 | +4. **Skalierung**: Load-Balancing, Database-Backup, Disaster-Recovery |
| 161 | + |
| 162 | +Siehe [SECURITY.md](./SECURITY.md) fuer Mindestanforderungen. |
| 163 | + |
| 164 | +## Lizenz |
| 165 | + |
| 166 | +MIT License - siehe [LICENSE](./LICENSE) |
| 167 | + |
| 168 | +## Contributing |
| 169 | + |
| 170 | +Contributions sind willkommen! Siehe [CONTRIBUTING.md](./CONTRIBUTING.md) fuer Details. |
| 171 | + |
| 172 | +--- |
| 173 | + |
| 174 | +## Weitere Ressourcen |
| 175 | + |
| 176 | +- **Portfolio**: [bojatschkin.de](https://bojatschkin.de) – Cloud Engineer mit KI-Integration |
| 177 | +- **Blogpost**: [RAG-Chatbot mit Bedrock – Praxiswissen aus Unternehmensdokumenten](https://bojatschkin.de/blog/rag-chatbot-bedrock?utm_source=github&utm_medium=readme&utm_campaign=rag-chatbot-demo) |
| 178 | +- **Kontakt**: Wenn du den PoC in einen produktiven Wissensassistenten mit sauberem Betriebskonzept ueberfuehren willst → [Kostenloses Erstgesprach buchen](https://bojatschkin.de?utm_source=github&utm_medium=readme&utm_campaign=rag-chatbot-contact) |
| 179 | + |
| 180 | +--- |
| 181 | + |
| 182 | +Built by [vibtellect](https://github.com/vibtellect) – Cloud Engineering & AI Integration |
0 commit comments