Busabase
Busabase는 AI 에이전트를 위한 오픈소스(MIT) 데이터베이스 및 작업 공간입니다
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗models.py — SQLAlchemy data model (MPs, FY ledgers, works, societies, inspections)rules_engine.py — the compliance rules engine (10 rules covering financial,
geospatial, negative-list, society, and SLA checks from the guidelines)example_check.py — standalone runnable demo (no server needed)api.py — FastAPI wrapper exposing POST /check-compliancerequirements.txtpip install -r requirements.txt
# Option A: run the standalone demo
python example_check.py
# Option B: run the API
uvicorn api:app --reload
# then POST to http://localhost:8000/check-compliance
# see `example_payload` at the bottom of api.py for the request shape
# interactive docs auto-generated at http://localhost:8000/docs
Start with the API as a microservice. Don't try to merge this logic
into your main app's codebase directly. Run it as a separate FastAPI
service. Your main app (whatever manages work recommendations) calls
POST /check-compliance whenever a work is created or edited, and
gets back APPROVED / NEEDS_REVIEW / BLOCKED plus the per-rule
breakdown. This keeps the compliance logic swappable and testable
independent of your UI/main app.
Persist real ledgers, not in-memory ones. api.py currently takes
a ledger snapshot in the request body so you can test without a DB.
For real use: point it at a real Postgres/SQLite DB using models.py,
look up the MP's actual FinancialYearLedger row by mp_id +
financial_year, and update it transactionally the moment a work is
sanctioned (increment cumulative_sanctioned, repair_renovation_sanctioned,
etc. — see the models.py docstring on why this ledger must hold running
totals rather than being recomputed from scratch each time).
Add rules incrementally, don't try to cover every para on day one.
Start with the ~10 rules already implemented (they cover the highest-
frequency checks: entitlement ceiling, minimum work amount, repair
ceiling, out-of-constituency cap, jurisdiction, negative list, society
eligibility, and two SLA timers). Add SC/ST hard quota enforcement,
calamity relief timelines, and admin expenditure caps next — each is
a new Rule subclass in rules_engine.py, nothing else needs to change.
Never auto-reject on the negative-list rule alone. It's marked
REVIEW severity on purpose. Route anything it flags to a human
reviewer queue in your UI. If you want to reduce false positives,
replace NegativeListRule._keyword_hits with a call to an LLM
classifier that reasons about the actual work description instead
of raw keyword matching — the rest of the engine doesn't need to change.
Log every check. Use the ComplianceCheckLog table in models.py
to persist every RuleResult against the work — this becomes your
audit trail when the CAG/State auditors ask "how was this work checked."
context dict (MP type, allowed districts, calamity flag,
any linked society, written justification if under ₹2.5L)ComplianceEngine().evaluate(work, ledger, context)report.overall_status:
APPROVED → proceed to sanction, update the ledgerNEEDS_REVIEW → hold, route to human reviewer with the flagged rulesBLOCKED → reject automatically, return the failing rule messages
to whoever submitted the recommendation