Back to the list
chat.rentaicoder.com/law.html
Vietnamese Legal AI Assistant
An agent that picks its own retrieval tool and cites the exact article
Legal chatbots fail at citation: they invent article numbers. This system never lets the model answer from memory — every answer goes through one of five lookup tools over an offline corpus of nine digitised Vietnamese legal codes.
Visit product— Vietnamese Legal AI Assistant (opens in a new tab)
- .NET 10
- NTG.Adk
- BM25
- ONNX
- SQLite
§ 01 — Algorithm
tools = [
read_summaries() # chỉ mục kỹ thuật toàn corpus → định hướng
search_law_embedding(q, n) # ngữ nghĩa tình huống, 768-dim
search_law_bm25(q, n) # từ khoá
search_law_grep(q, n) # tra chính xác "Điều 34 khoản 2"
get_references(article) # tham chiếu chéo giữa các luật
]
loop:
agent chọn tool theo dạng câu hỏi # không phải RAG một chiều cố định
nếu turn % 10 == 0: compact(events) # EventsCompactionConfig.CompactionInterval
answer := vấn đề pháp lý
→ trích nguyên văn Điều/Khoản
→ quyền & nghĩa vụ từng bên
→ hướng xử lý thực tế§ 02 — Highlights
- Nine Vietnamese legal codes digitised and vector-indexed, including the 2025 AI Law
- Five tools: corpus index, semantic, keyword, exact article lookup, cross-reference
- Offline corpus — there is no path for the model to invent an article that does not exist
- Context compaction every ten turns keeps long threads coherent
- Token-by-token streaming over Server-Sent Events
§ 03 — Screens

