Charles Grandjean commited on
Commit
bcd1b4c
Β·
1 Parent(s): 851f2ed

add data and fixes

Browse files
.dockerignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ .env
2
+ .git
3
+ __pycache__/
4
+ *.pyc
5
+ .DS_Store
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ rag_storage/*.json filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ .env
2
+ __pycache__/
3
+ *.pyc
4
+ .DS_Store
Dockerfile CHANGED
@@ -30,64 +30,14 @@ COPY . .
30
 
31
  # Create non-root user for security
32
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
33
- USER appuser
34
 
35
- # Create startup script
36
- RUN echo '#!/bin/bash\n\
37
- set -e\n\
38
- \n\
39
- echo "πŸš€ Starting CyberLegal AI Stack..."\n\
40
- echo "Step 1: Starting LightRAG server..."\n\
41
- \n\
42
- # Start LightRAG server in background\n\
43
- lightrag-server --host $LIGHTRAG_HOST --port $LIGHTRAG_PORT &\n\
44
- LIGHTRAG_PID=$!\n\
45
- \n\
46
- # Wait for LightRAG to be ready\n\
47
- echo "Waiting for LightRAG server to be ready..."\n\
48
- max_attempts=30\n\
49
- attempt=1\n\
50
- while [ $attempt -le $max_attempts ]; do\n\
51
- if curl -f http://$LIGHTRAG_HOST:$LIGHTRAG_PORT/health > /dev/null 2>&1; then\n\
52
- echo "βœ… LightRAG server is ready!"\n\
53
- break\n\
54
- fi\n\
55
- echo "Attempt $attempt/$max_attempts: LightRAG not ready yet..."\n\
56
- sleep 2\n\
57
- attempt=$((attempt + 1))\n\
58
- done\n\
59
- \n\
60
- if [ $attempt -gt $max_attempts ]; then\n\
61
- echo "❌ LightRAG server failed to start"\n\
62
- exit 1\n\
63
- fi\n\
64
- \n\
65
- echo "Step 2: Starting LangGraph API server..."\n\
66
- echo "🌐 API will be available at: http://localhost:$API_PORT"\n\
67
- echo "πŸ“š LightRAG server running at: http://$LIGHTRAG_HOST:$LIGHTRAG_PORT"\n\
68
- echo ""\n\
69
- echo "Available endpoints:"\n\
70
- echo " - GET /health - Health check"\n\
71
- echo " - GET / - API info"\n\
72
- echo " - POST /chat - Chat with assistant"\n\
73
- echo ""\n\
74
- echo "πŸŽ‰ CyberLegal AI is ready!"\n\
75
- \n\
76
- # Start the API server\n\
77
- python agent_api.py\n\
78
- \n\
79
- # Cleanup\n\
80
- kill $LIGHTRAG_PID 2>/dev/null || true\n\
81
- ' > /app/startup.sh
82
 
83
- RUN chmod +x /app/startup.sh
84
 
85
- # Expose ports (API only for security, LightRAG stays internal)
86
  EXPOSE 8000
87
 
88
- # Health check for the API
89
  HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
90
- CMD curl -f http://localhost:8000/health || exit 1
91
 
92
- # Run the startup script
93
- CMD ["/app/startup.sh"]
 
30
 
31
  # Create non-root user for security
32
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
 
33
 
34
+ RUN chmod +x /app/startup.sh && chown appuser:appuser /app/startup.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
+ USER appuser
37
 
 
38
  EXPOSE 8000
39
 
 
40
  HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
41
+ CMD sh -c 'curl -f http://localhost:${PORT:-8000}/health || exit 1'
42
 
43
+ CMD ["/app/startup.sh"]
 
rag_storage/kv_store_doc_status.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:309b48238b8853a5e1380e8202534eb896da93561462b947a1ee648adc7cf73d
3
+ size 35812
rag_storage/kv_store_entity_chunks.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:515c0e6f05ae32ab87d73d8c09b30324c7601b6dcf994f78ab6dca24a2c468e6
3
+ size 1289498
rag_storage/kv_store_full_docs.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a2ce58b26969dae661a9808be1fa20bd972ce18d15bcaabedd1219b878d7ba2
3
+ size 2864044
rag_storage/kv_store_full_entities.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5c4388472db8b3f3519c4bf78f08dbedf94a44abafed2517fa2cca73b8350b5
3
+ size 175853
rag_storage/kv_store_full_relations.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ac82d39371f490247f2f9b961624c2d72568b7087a5477f927ca756e83359b4
3
+ size 350564
rag_storage/kv_store_llm_response_cache.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b530175acd7dd02605748a846c988bdec8651b0bb6090d6af808c15824dacce
3
+ size 31129737
rag_storage/kv_store_relation_chunks.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9986b500dfb603ad44c42d9d5d88bff416e3d4eca47dea0e9c8748cef5ad1a4
3
+ size 1184276
rag_storage/kv_store_text_chunks.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66a70cbdef477b1ab7b66b29fbf156fce65e8dd50de8c5698d177e01690b1edb
3
+ size 3428391
rag_storage/vdb_chunks.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:653a122bea932df9c3aec5853d8e3a0c693aa150958b5ef62543d5cacc7b2ca7
3
+ size 18533895
rag_storage/vdb_entities.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa886e92b33a43033ce138121f12574e10d35e3cd2acc48b9bcda8bdab412258
3
+ size 124984482
rag_storage/vdb_relationships.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc4dad69ba410410554fcebaa3595ced6b520e26a301029a72d31d432d08bde9
3
+ size 109748156
startup.sh CHANGED
@@ -3,8 +3,6 @@ set -euo pipefail
3
 
4
  LIGHTRAG_HOST="${LIGHTRAG_HOST:-127.0.0.1}"
5
  LIGHTRAG_PORT="${LIGHTRAG_PORT:-9621}"
6
-
7
- # Platform public port (Render/Koyeb/etc) or local fallback
8
  PUBLIC_PORT="${PORT:-${API_PORT:-8000}}"
9
 
10
  echo "πŸš€ Starting CyberLegal AI Stack..."
@@ -14,36 +12,20 @@ lightrag-server --host "${LIGHTRAG_HOST}" --port "${LIGHTRAG_PORT}" &
14
  LIGHTRAG_PID=$!
15
 
16
  cleanup() {
17
- echo "🧹 Shutting down..."
18
  kill -TERM "${LIGHTRAG_PID}" 2>/dev/null || true
19
  wait "${LIGHTRAG_PID}" 2>/dev/null || true
20
  }
21
  trap cleanup EXIT INT TERM
22
 
23
  echo "Waiting for LightRAG server to be ready..."
24
- max_attempts=30
25
- attempt=1
26
- while [ "${attempt}" -le "${max_attempts}" ]; do
27
  if curl -fsS "http://${LIGHTRAG_HOST}:${LIGHTRAG_PORT}/health" >/dev/null 2>&1; then
28
- echo "βœ… LightRAG server is ready!"
29
  break
30
  fi
31
- echo "Attempt ${attempt}/${max_attempts}: LightRAG not ready yet..."
32
  sleep 2
33
- attempt=$((attempt + 1))
34
  done
35
 
36
- if [ "${attempt}" -gt "${max_attempts}" ]; then
37
- echo "❌ LightRAG server failed to start"
38
- exit 1
39
- fi
40
-
41
- echo "Step 2: Starting LangGraph API server on 0.0.0.0:${PUBLIC_PORT} ..."
42
- echo "🌐 API: http://localhost:${PUBLIC_PORT}"
43
- echo "πŸ“š RAG: http://${LIGHTRAG_HOST}:${LIGHTRAG_PORT}"
44
- echo "πŸŽ‰ Ready!"
45
-
46
- # Ensure FastAPI reads the correct port on platforms
47
  export PORT="${PUBLIC_PORT}"
48
-
49
  python agent_api.py
 
3
 
4
  LIGHTRAG_HOST="${LIGHTRAG_HOST:-127.0.0.1}"
5
  LIGHTRAG_PORT="${LIGHTRAG_PORT:-9621}"
 
 
6
  PUBLIC_PORT="${PORT:-${API_PORT:-8000}}"
7
 
8
  echo "πŸš€ Starting CyberLegal AI Stack..."
 
12
  LIGHTRAG_PID=$!
13
 
14
  cleanup() {
 
15
  kill -TERM "${LIGHTRAG_PID}" 2>/dev/null || true
16
  wait "${LIGHTRAG_PID}" 2>/dev/null || true
17
  }
18
  trap cleanup EXIT INT TERM
19
 
20
  echo "Waiting for LightRAG server to be ready..."
21
+ for i in {1..30}; do
 
 
22
  if curl -fsS "http://${LIGHTRAG_HOST}:${LIGHTRAG_PORT}/health" >/dev/null 2>&1; then
23
+ echo "βœ… LightRAG is ready!"
24
  break
25
  fi
 
26
  sleep 2
 
27
  done
28
 
 
 
 
 
 
 
 
 
 
 
 
29
  export PORT="${PUBLIC_PORT}"
30
+ echo "Step 2: Starting API on 0.0.0.0:${PORT} ..."
31
  python agent_api.py