Luthor เป็นระบบ Retrieval-Augmented Generation (RAG) ที่ออกแบบมาสำหรับ บริษัท กฎหมายเพื่อให้นักกฎหมายสามารถ "พูดคุยกับข้อมูล" ได้อย่างมีประสิทธิภาพ ระบบนี้อนุญาตให้ผู้เชี่ยวชาญด้านกฎหมายอัปโหลดเอกสาร (เช่นบันทึก memos) ไปยังฐานข้อมูลเวกเตอร์ที่เก็บไว้ใน Pinecone และต่อมาสอบถามข้อมูลนี้โดยใช้อินเทอร์เฟซคล้ายแชทบอทที่สร้างขึ้นด้วย Streamlit
src/data_loader.py ): จัดการการอ่านรูปแบบไฟล์ต่างๆsrc/preprocessor.py ): เตรียมข้อความสำหรับการฝังและการจัดเก็บapp.py ): อินเตอร์เฟส StreamLit สำหรับการอัปโหลดเอกสารและการสืบค้นLuthor ถูกนำไปใช้กับ AWS โดยใช้สถาปัตยกรรมคอนเทนเนอร์:
โคลนที่เก็บ:
git clone https://github.com/boemer00/luthor.git
cd luthor
สร้างภาพนักเทียบท่า:
docker build -t luthor .
กดภาพไปที่ Amazon ECR:
aws ecr get-login-password --region [your-region] | docker login --username AWS --password-stdin [your-account-id].dkr.ecr.[your-region].amazonaws.com
docker tag luthor:latest [your-account-id].dkr.ecr.[your-region].amazonaws.com/luthor:latest
docker push [your-account-id].dkr.ecr.[your-region].amazonaws.com/luthor:latest
ตั้งค่า AWS Secrets Manager: สร้างความลับสำหรับ OpenAI_API_KEY, PINECONE_API_KEY และ PINECONE_ENVironment
ปรับใช้คำจำกัดความงาน ECS:
aws ecs register-task-definition --cli-input-json file://infrastructure/ecs-task-definition.json
สร้างบริการ ECS:
aws ecs create-service --cluster [your-cluster-name] --service-name luthor-service --task-definition luthor-app --desired-count 1 --launch-type FARGATE --network-configuration "awsvpcConfiguration={subnets=[subnet-xxxxxxxx,subnet-yyyyyyyy],securityGroups=[sg-xxxxxxxxxxxxxxxx]}" --load-balancers "targetGroupArn=arn:aws:elasticloadbalancing:[region]:[account-id]:targetgroup/[target-group-name]/[target-group-id],containerName=luthor-app,containerPort=8501"
เข้าถึงแอปพลิเคชัน Luthor ผ่านชื่อ DNS ของแอปพลิเคชัน Load Balancer
การอัปโหลดเอกสาร :
การสอบถาม :
สงวนลิขสิทธิ์
รหัสนี้และไฟล์ที่เกี่ยวข้องทั้งหมดเป็นคุณสมบัติพิเศษของ Renato Boemer ไม่มีส่วนหนึ่งของรหัสนี้ในรูปแบบใด ๆ หรือโดยวิธีการใด ๆ อาจถูกคัดลอกทำซ้ำดัดแปลงดัดแปลงดัดแปลงเก็บไว้ในระบบดึงข้อมูลหรือส่งโดยไม่ได้รับอนุญาตจาก Renato Boemer