-
Notifications
You must be signed in to change notification settings - Fork 173
Description
Proposal: Agentic Workflow for Intelligent Template Drafting (GSoC 2026 MVP)
Overview
This proposal outlines an implementation strategy for the Agentic Workflow for Drafting Templates project, targeting GSoC 2026. The objective is to lower the barrier to entry for users by automating the creation of valid Concerto models (.cto) and Cicero templates from natural language descriptions.
I have developed a Minimum Viable Product (MVP) that demonstrates a multi-stage agent pipeline capable of converting raw text requirements into syntactically correct and validated Concerto code.
Problem Statement
Creating Accord Project templates currently requires deep knowledge of:
- The Concerto modeling language (CTO).
- The Ergo logic language.
- The specific structure of Accord Project projects.
This creates a steep learning curve for legal engineers or domain experts who understand the "what" (legal requirements) but not the "how" (code implementation).
Proposed Solution
Our solution implements an Agentic Pipeline that breaks the generation process into distinct, verifiable steps. Instead of asking a single Large Language Model (LLM) to "write the whole code" (which is error-prone), we separate concerns into specialized agents:
- Requirements Agent: Acts as an analyst. It processes natural language input to extract structured intent (Concepts, Fields, Relationships) without worrying about syntax.
- Model Generator Agent: Acts as a developer. It takes the structured intent and translates it into valid Concerto syntax.
- Validation Loop: A deterministic feedback loop that uses the official
@accordproject/concerto-clito validate the output. If the CLI reports errors, the agent self-corrects based on the specific error message.
Architecture
The following diagram illustrates the MVP pipeline:
+---------------------+
| User Input |
| "Loan agreement..." |
+----------+----------+
|
v
+---------------------+
| Requirements Agent |
| (Extracts Intent) |
+----------+----------+
|
v
+---------------------+
| Generator Agent | <------+
| (Writes .cto code) | |
+----------+----------+ | Error
| | Feedback
v |
+---------------------+ |
| Validation Loop +-----------+
| (concerto-cli check)| No
+----------+----------+
|
| Yes
v
+---------------------+
| Valid .cto Output |
+---------------------+
MVP Implementation Status
We have implemented a working prototype in Python that orchestrates this workflow. The system currently supports:
- CLI Interface: Accepts natural language descriptions of contracts (e.g., "A loan agreement with interest rate and borrower details").
- Dual-Agent System: Separates requirements gathering from code generation for higher accuracy.
- Self-Correction: Automatically fixes syntax errors by parsing
concerto-clierror logs. - Web Interface: A simple frontend to demonstrate the generation process.
Repository:
Code and documentation for the MVP are available here:
https://github.com/adarshh347/accordo-agent-gsoc-2026
I’m currently waiting for feedback on this architecture and how well it aligns with the Accord Project’s long-term usability goals, so that I can further build on it in line with the project’s direction and evolving requirements.