Architecture for legal document agents
A day of studying a detection project and structuring docs, architecture, Docker, and decisions for citation extraction.
Today centered on understanding and structuring an agent project for legal document analysis. Before writing more code, I needed to make the architecture explainable.
Project foundation
I started by reading the repository, identifying the stack, and creating guidance docs for agents. The project gained AGENTS.md, CLAUDE.md, Mermaid diagrams, a design system view, and a clearer description of communication between backend, frontend, and agents.
I also prepared a Docker structure to run backend and frontend on separate ports. The goal was to lower the cost of entry: any agent or person should be able to start the system, understand the parts, and know where to work.
Citation extraction
The main technical theme was citation extraction in documents. The question was not only "how do we use an agent", but where deterministic code should enter. At high volume, predictable patterns need parsing, validation, and tests. An agent can help with ambiguous cases, but it should not be the first tool for everything.
I also started turning the product intent into a PRD and specification. That helped separate goals, architecture, and tasks.
It was a good day to remember that agents work better when the project already has a map, boundaries, and shared vocabulary.