Valencev3

D 59 completed
Api
containerized / python · small
71
Files
20,555
LOC
1
Frameworks
5
Languages

Pipeline State

completed
Run ID
#367287
Phase
done
Progress
1%
Started
Finished
2026-04-13 01:31:02
LLM tokens
0

Pipeline Metadata

Stage
Skipped
Decision
skip_scaffold_dup
Novelty
51.67
Framework unique
Isolation
Last stage change
2026-04-16 18:15:42
Deduplication group #47702
Member of a group with 1 similar repo(s) — canonical #29960 view group →
Top concepts (2)
Project DescriptionWeb Backend
Repobility · MCP-ready · https://repobility.com

AI Prompt

Create a backend service using FastAPI that analyzes legal credit agreements. The system needs to extract structured data, ensuring every piece of information has provenance linking it to the source text, page, and section. It should use the Claude API for initial document extraction and PyMuPDF for PDF text extraction. The core functionality involves storing and querying this data against a TypeDB Cloud instance, which acts as the single source of truth. Finally, I need endpoints to list deals, upload PDFs for extraction, and perform accurate Q&A against the structured data stored in TypeDB.
python fastapi backend legal-tech document-analysis typedb api pdf-processing
Generated by gemma4:latest

Catalog Information

A backend service that extracts structured data from credit agreements and provides accurate Q&A over the extracted data.

Description

Valence Backend is a FastAPI-powered service that ingests credit agreement PDFs, extracts typed primitives using a language model, and stores them in a graph database. It exposes a RESTful API for uploading documents, retrieving structured entities, and querying answers to contract‑specific questions. The system guarantees provenance by linking each primitive to its source text, page, and section. Designed for legal and compliance teams, it enables precise, schema‑driven Q&A without hard‑coded rules. The architecture emphasizes a single source of truth and leverages inference rules for advanced pattern detection.

الوصف

يُعد Valence Backend خدمة خلفية تعتمد على FastAPI تقوم بتحميل ملفات PDF الخاصة باتفاقيات الائتمان واستخراج القيم المنظمة (السمات المهيكلة) باستخدام نموذج لغة. تُخزن هذه القيم في قاعدة بيانات رسمية على شكل مخطط، مع ربط كل قيمة بمصدرها النصي، الصفحة، والقسم لضمان تتبع الأصول. يتيح واجهة برمجة التطبيقات RESTful للمستخدمين رفع المستندات، استرجاع الكيانات المهيكلة، والاستعلام عن إجابات دقيقة على أسئلة متعلقة بشروط العقد. يستهدف المشروع فرق القانون والامتثال، حيث يوفر إجابات مبنية على مخطط قاعدة البيانات بدلاً من قوائم ثابتة، ما يضمن دقة 100٪ في الاستفسارات. يميز النظام استخدامه للوظائف المخصصة في قاعدة البيانات لتطبيق قواعد استنتاج معقدة، مما يتيح اكتشاف الثغرات أو الأنماط غير المتوقعة في النصوص القانونية. كما يركز على مصدر موثوق واحد (SSoT) لتوحيد البيانات وتسهيل الصيانة والتوسع.

Novelty

7/10

Tags

legal-document-analysis structured-data-extraction q&a typed-primitives graph-database provenance-tracking

Technologies

anthropic fastapi pydantic uvicorn

Claude Models

claude-opus-4.6

Quality Score

D
59.1/100
Structure
55
Code Quality
54
Documentation
78
Testing
40
Practices
64
Security
75
Dependencies
60

Strengths

  • Consistent naming conventions (snake_case)
  • Containerized deployment (Docker)

Weaknesses

  • No LICENSE file \u2014 legal ambiguity for contributors
  • No CI/CD configuration \u2014 manual testing and deployment
  • 1 bare except/catch blocks swallowing errors
  • 3002 duplicate lines detected \u2014 consider DRY refactoring
  • 7 'god files' with >500 LOC need decomposition

Recommendations

  • Set up CI/CD (GitHub Actions recommended) to automate testing and deployment
  • Add a linter configuration to enforce code style consistency
  • Add a LICENSE file (MIT recommended for open source)
  • Replace bare except/catch blocks with specific exception types

Security & Health

6.8h
Tech Debt (A)
A
OWASP (100%)
PASS
Quality Gate
A
Risk (1)
Repobility analyzer · published findings · https://repobility.com
Unknown
License
8.4%
Duplication
Full Security Report AI Fix Prompts SARIF SBOM

Languages

python
92.2%
markdown
4.5%
typescript
3.2%
text
0.1%
toml
0.0%

Frameworks

FastAPI

Concepts (2)

Repobility analysis · methodology at https://repobility.com/research/
CategoryNameDescriptionConfidence
Want this analysis on your repo? https://repobility.com/scan/
auto_descriptionProject DescriptionLegal document analysis platform that extracts typed primitives from credit agreements and enables 100% accurate Q&A against structured data in TypeDB.80%
auto_categoryWeb Backendweb-backend70%

Quality Timeline

1 quality score recorded.

View File Metrics

Embed Badge

Add to your README:

![Quality](https://repos.aljefra.com/badge/91477.svg)
Quality BadgeSecurity Badge
Export Quality CSVDownload SBOMExport Findings CSV