cd /news/artificial-intelligence/how-i-built-an-ai-agent-system-for-a… · home topics artificial-intelligence article
[ARTICLE · art-85838] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

How I Built an AI Agent System for a Corporate Law Firm — During My Internship

An engineering intern at a corporate law firm built an open-source template that enables firms to deploy AI agents for tasks such as contract drafting, legal research, and compliance checks. The system, available on GitHub, integrates with CLI-based AI agents like Claude Code and Qwen Code, and includes ethical guardrails to ensure human oversight. The intern developed the working system during a two-week internship challenge, demonstrating a practical application of AI in legal workflows.

read5 min views3 publishedAug 4, 2026

TL;DR: I built an open-source template that lets corporate law firms deploy AI agents using Obsidian + CLI tools (Claude Code, Qwen Code, Cursor). It handles contract drafting, legal research, due diligence, compliance checks, client intake, and wiki maintenance — all organized with PARA methodology and built-in ethical guardrails.

GitHub repo: M0rtal13/Agentic-AI-for-Enterprise

Two weeks ago, I started a corporate law firm internship. On day one, my supervisors gave the interns a challenge:

"Think critically about how AI tools might support a modern corporate law practice... On the last day, share 3–5 minutes of reflections and offer one or two concrete ideas on how AI could help improve workflow."

Most interns planned to make PowerPoint slides with bullet points.

I decided to build the actual system instead of just talking about it.

Over the next two weeks, while working on real legal research and document review tasks, I built an open-source template that any law firm can deploy. Not a demo — a working system with skills, guardrails, and a phased rollout plan.

This is what I built and how it works.

During my internship, I noticed the same patterns:

These tasks are high-volume, pattern-based, and time-consuming — perfect for AI assistance.

But law firms have unique constraints:

The system combines three things:

All firm knowledge is organized into five folders:

00_inbox/          ← Unprocessed captures
01_projects/       ← Active matters (matter-2026-001-acquisition/)
02_areas/          ← Ongoing responsibilities (corporate-advisory/, m-a/, compliance/)
03_resources/      ← Precedents, clause library, legislation, case law
04_archive/        ← Completed matters
wiki/              ← AI-powered knowledge base

Every matter, document, and research memo has a defined location and naming convention. The AI agent operates on this structure.

The system works with any CLI-based AI agent:

These agents read a CLAUDE.md

/ AGENTS.md

file that defines:

The repo includes six fully-functional skills:

Skill What it does
Contract Drafting
Identifies document type, locates precedent, gathers transaction details, drafts from template, quality checks
Legal Research
Frames question, identifies sources (priority order), researches, structures memo (Issue/Short Answer/Analysis/Authorities/Limitations), verifies citations
Due Diligence
Understands scope, triages documents, extracts parties/obligations/restrictions/termination/liability, classifies risk (High/Medium/Low), populates report
Compliance Check
Profiles entity, identifies obligations across categories (corporate/financial/listing/sector-specific/employment), generates table, flags urgent items
Client Intake
Collects client info, runs conflict check, creates matter folder, prepares engagement letter
Wiki Maintenance
Identifies stale pages (90-day review cycle), creates/updates pages using standard template, ensures tag consistency, logs changes

Each skill is a markdown file with step-by-step procedures, rules, and quality checks. The agent follows these procedures when you invoke the skill.

You: "Draft a bilateral NDA for a tech company acquiring a startup in Hong Kong"

Agent:

03_resources/precedents/standard-nda-bilateral.md

01_projects/matter-2026-001-acquisition/drafts/nda-draft-v1.md

You: Review the draft, request changes, approve.

The agent never sends anything to the client without your explicit approval. It drafts, you decide.

You: "Research whether a listed company in Hong Kong needs shareholder approval for a change in auditors"

Agent:

01_projects/matter-2026-001-acquisition/research/2026-08-04 - Auditor Change Approval - ClientA.md

You: Review the memo, verify citations, rely on it for client advice.

The agent cites everything. If it can't find authority, it says so instead of making it up.

The system enforces non-negotiable guardrails:

[REQUIRES VERIFICATION]

Task Agent can do autonomously Requires human sign-off
Draft contracts Yes (saved to drafts/) Before sending to client
Legal research Yes (saved to research/) Before relying in advice
Due diligence review Yes (saved to research/) Before including in DD report
Compliance checklists Yes Before sending to client
Client communications Draft only Always requires partner approval
Conflict checking Search and flag Partner must review results
Filing submissions Draft only Always requires partner approval

The repo includes three options for connecting to your firm's file system:

Point Obsidian at a OneDrive-synced directory. The agent operates on local files. OneDrive handles sync.

Best for: Solo practitioners.

Agent uses Microsoft Graph API to read/write files in OneDrive or SharePoint. OAuth 2.0 provides authenticated, audited access. Local PARA structure acts as working memory.

Best for: Mid-size to large firms.

Build a web interface backed by SharePoint. Lawyers access via browser.

Best for: Large firms needing multi-office access or client portals.

Full setup instructions in the Getting Started guide.

The repo includes a 13-week implementation roadmap:

Phase Timeline Deliverables
1 — Discovery
Weeks 1–2 Task audit, stakeholder interviews, priority matrix
2 — Pilot Design
Weeks 3–4 Select 2–3 high-priority tasks, define success metrics, choose LLM provider
3 — Build & Test
Weeks 5–8 Vault setup, agent configuration, precedent ingestion, integration testing
4 — Controlled Rollout
Weeks 9–10 Deploy to single practice group with partner supervision
5 — Iteration
Weeks 11–12 Refine skills, expand clause library, address edge cases
6 — Firm-Wide
Week 13+ Roll out to all practice groups, establish governance

Success metrics:

This isn't another "AI will change law" think piece. It's a working system you can deploy today.

GitHub repo: M0rtal13/Agentic-AI-for-Enterprise

Quick start:

git clone https://github.com/M0rtal13/Agentic-AI-for-Enterprise.git
cd Agentic-AI-for-Enterprise
bash setup.sh --vault ~/LawFirmVault

Then open the vault in Obsidian, configure your CLI agent (Claude Code, Qwen Code, Cursor, etc.), and start using the skills.

Full documentation in the docs/

folder:

I'm a secondary 4 student in an IB bridging programme. I'm not a lawyer, I'm not a senior developer. But I noticed a problem during my internship — law firms waste time on repetitive work that AI can handle — so I built a solution.

The legal profession is conservative about technology. That's understandable — the stakes are high, mistakes are costly, and confidentiality is sacred. But that doesn't mean we can't move forward. It means we need to move forward carefully, with guardrails, audit trails, and human oversight.

This system is my attempt to show that it's possible. AI can assist lawyers without replacing them. It can handle the repetitive work while humans focus on judgment, strategy, and client relationships.

If you're a law firm exploring AI, or a student interested in legal tech, fork the repo, try it out, and let me know what you think.

GitHub: M0rtal13/Agentic-AI-for-Enterprise

Tags: #LegalTech #AIAgents #Obsidian #PARA #CorporateLaw #OpenSource

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @m0rtal13 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-i-built-an-ai-ag…] indexed:0 read:5min 2026-08-04 ·