feat: enhance chat service with documentation indexing and improved Docker configuration
Some checks failed
CI/CD Pipeline / Generate Documentation (push) Failing after 7m41s
CI/CD Pipeline / Lint Code (push) Failing after 7m44s
CI/CD Pipeline / Run Tests (push) Has been skipped
CI/CD Pipeline / Security Scanning (push) Has been skipped
CI/CD Pipeline / Build and Push Docker Images (api) (push) Has been skipped
CI/CD Pipeline / Build and Push Docker Images (chat) (push) Has been skipped
CI/CD Pipeline / Build and Push Docker Images (frontend) (push) Has been skipped
CI/CD Pipeline / Build and Push Docker Images (worker) (push) Has been skipped
CI/CD Pipeline / Deploy to Staging (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped

This commit is contained in:
2025-10-20 19:15:32 +02:00
parent 6f5deb0879
commit 27dd9e00b6
14 changed files with 784 additions and 94 deletions

45
scripts/start_chat.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
# Startup script for chat service with documentation indexing
set -e
echo "=== Datacenter Documentation Chat Service ==="
echo "Starting initialization..."
# Check if vector store needs initialization
VECTOR_STORE_PATH="/app/data/chroma_db"
INDEX_MARKER="$VECTOR_STORE_PATH/.indexed"
if [ ! -f "$INDEX_MARKER" ]; then
echo ""
echo "=== First Time Setup ==="
echo "Indexing documentation into vector store..."
echo "This may take a few minutes..."
echo ""
# Run indexing script
python /app/scripts/index_docs.py
# Create marker file to prevent re-indexing
if [ $? -eq 0 ]; then
mkdir -p "$VECTOR_STORE_PATH"
touch "$INDEX_MARKER"
echo ""
echo "✓ Documentation indexed successfully!"
else
echo ""
echo "⚠ Warning: Documentation indexing failed. Chat will work with limited functionality."
echo " The chat service will still start but won't have access to indexed documentation."
fi
else
echo "✓ Vector store already initialized (found marker: $INDEX_MARKER)"
echo " To re-index, delete the volume: docker volume rm datacenter-docs-chat-data-dev"
fi
echo ""
echo "=== Starting Chat Server ==="
echo "Listening on port 8001..."
echo ""
# Start the chat server
exec python -m datacenter_docs.chat.main