AI SummaryCursor rules for LangGraph multi-agent legal document processing workflows, providing architecture guidelines and patterns for orchestrating specialized legal analysis agents. Beneficial for developers building legal tech systems with LLM-based document workflows.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "lemcs — Cursor Rules" prompt rules to my project. Repository: https://github.com/medelman17/lemcs Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
LangGraph multi-agent system guidelines for legal document processing workflows
Agent Architecture Overview
The LeMCS system uses LangGraph for orchestrating specialized legal agents in document processing workflows.
Core Agent Components
• Orchestrator (@agents/orchestrator.py) - Workflow coordination • Legal Analyzer (@agents/legal_analyzer.py) - Document analysis • Citation Extractor (@agents/citation_extractor.py) - Citation processing • Synthesis Agent (@agents/synthesis_agent.py) - Document consolidation
State Graph Definition
`python from langgraph import StateGraph from typing import TypedDict, List, Dict, Any class AgentState(TypedDict): """Shared state across all agents.""" documents: List[str] analyses: List[Dict[str, Any]] citations: List[Dict[str, Any]] consolidated_output: str errors: List[str] current_step: str def create_workflow() -> StateGraph: """Create the legal document processing workflow.""" workflow = StateGraph(AgentState) # Add agent nodes workflow.add_node("analyze", legal_analysis_agent) workflow.add_node("extract_citations", citation_extraction_agent) workflow.add_node("synthesize", synthesis_agent) # Define workflow edges workflow.add_edge("analyze", "extract_citations") workflow.add_edge("extract_citations", "synthesize") return workflow `
Agent Implementation Pattern
`python from nlp.hybrid_legal_nlp import HybridLegalNLP async def legal_analysis_agent(state: AgentState) -> AgentState: """Analyze legal documents using hybrid NLP.""" nlp = HybridLegalNLP() analyses = [] for document in state["documents"]: try: analysis = nlp.comprehensive_analysis(document) analyses.append(analysis) except Exception as e: state["errors"].append(f"Analysis failed: {e}") state["analyses"] = analyses state["current_step"] = "analysis_complete" return state `
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts