Praktische Anleitung, um dieses Repository lokal zu starten (Python-API + optionales Next.js-UI).
main.py: einfache FastAPI-Demo mit/ingestund/chatapp.py: FastAPI-Endpunkt/graph/previewui/: Next.js Frontend (/chat,/ingest,/graph)
- Python 3.10+
- Node.js 18+ (für das UI)
- npm
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtWindows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txtDiese API bietet:
POST /ingestPOST /chat
Starten:
uvicorn main:app --reload --host 0.0.0.0 --port 8000Schnelltest in zweitem Terminal:
curl -X POST http://localhost:8000/ingest \
-H "Content-Type: application/json" \
-d '{"documents":["FastAPI builds APIs quickly","GraphRAG uses retrieval"]}'
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"question":"What uses retrieval?"}'Diese API bietet:
GET /graph/preview?entity_keys=A,B,C
Starten:
uvicorn app:app --reload --host 0.0.0.0 --port 8080Schnelltest:
curl "http://localhost:8080/graph/preview?entity_keys=A,B,C"Wenn beide Python-Backends parallel laufen sollen:
main.pyauf Port8000app.pyauf Port8080
Beispiel mit zwei Terminals:
# Terminal 1
uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2
uvicorn app:app --reload --host 0.0.0.0 --port 8080cd ui
npm install
npm run devDann im Browser öffnen: http://localhost:3000/chat
Hinweis: Das UI nutzt standardmäßig
http://localhost:8000als API-Basis (alsomain.py).
Backend:
pytestFrontend:
cd ui
npm run typecheck
npm run buildEine Schritt-für-Schritt-Anleitung zum Konfigurieren von OpenAI (OPENAI_API_KEY, Embedding-Modell, Chat-Modell) findest du hier:
docs/openai-ressourcen.md
Eine Schritt-für-Schritt-Anleitung für lokalen Start per Docker, .env-Konfiguration und Integrationstest (/ingest, /chat) findest du hier:
docs/milvus-neo4j-integration.md
ModuleNotFoundErrorin Python: sicherstellen, dass.venvaktiv ist undpip install -r requirements.txtausgeführt wurde.- Port bereits belegt: Backend auf anderem Port starten (z. B.
--port 8001) und ggf. UI-Konfiguration anpassen. - UI kann Backend nicht erreichen: prüfen, ob Backend wirklich auf
localhost:8000läuft.