Inspiration
Government paperwork and legal filings are still largely manual — citizens often struggle with lengthy forms, unclear legal terms, and repetitive errors. We wanted to create an AI agent that simplifies and automates this process, helping both citizens and government officers save time, reduce mistakes, and go paperless. By combining Amazon Bedrock, AgentCore, and SageMaker, we envisioned a system where an AI could understand, validate, and file legal forms automatically, while being compliant and multilingual.
What it does
DocuServe AI (Smart Legal Filing Agent) is an AI-powered government assistant that:
- Extracts key information from scanned legal documents using Amazon Textract
- Understands and validates form data using Amazon Bedrock (Claude/Titan)
- Predicts whether an application will be approved or rejected using SageMaker
- Stores structured document data in DynamoDB and file uploads in S3
- Provides multilingual summaries and error feedback to the citizen before submission
- Uses AWS Lambda + API Gateway to handle workflow orchestration in a serverless way In short, it helps citizens fill, verify, and file government legal documents — automatically.
How we built it
- Backend (Serverless Core): a) Designed an AWS CDK stack that deploys Lambda, S3, DynamoDB, and Bedrock integration. b) Built an Agent Orchestrator Lambda that handles: i) Document upload events ii) Calls to Textract for OCR iii) Prompt-based validation via Bedrock iv) Storing extracted data in DynamoDB
2) AI Layer a) Used Amazon Bedrock’s Claude model for prompt-based reasoning and validation. b) Created prompt templates for legal field validation, missing info detection, and multilingual translation. c) Developed a SageMaker notebook that trains a simple model to predict form rejection likelihood using synthetic data.
3) User Flow User uploads a document → triggers Lambda → data extraction (Textract) → AI validation (Bedrock) → stores data → returns a structured summary.
4) Infrastructure as Code Used AWS CDK to define all infrastructure components (Lambda, S3, DynamoDB, IAM roles, etc.).
Challenges we ran into
- Setting up AWS Bedrock access and permissions was tricky — required correct IAM policies and region support.
- Integrating multiple AI services (Bedrock + SageMaker + Textract) in a single Lambda workflow required careful event orchestration.
- Managing input/output formats between services and keeping the responses structured.
- Cost management — we optimized usage to avoid unnecessary API calls during development.
- Testing Bedrock AgentCore locally since it’s still a new AWS component.
Accomplishments that we're proud of
- Successfully deployed a fully serverless AI agent on AWS using Bedrock, Textract, and SageMaker together.
- Built a working CDK stack that can be extended to real-world government use cases.
- Designed prompt templates that can handle multilingual input and legal form validation.
- Created an explainable AI output — the agent not only flags issues but also explains why.
- Achieved end-to-end automation from document upload to data extraction to validation.
What we learned
- How to build production-ready AI Agents using Amazon Bedrock AgentCore.
- Orchestrating multiple AWS AI services using Lambda and CDK.
- Best practices in prompt design and data validation with foundation models.
- Managing permissions and deploying serverless AI systems safely using IAM and KMS.
- Realized the importance of explainability and transparency in AI systems used for governance.
What's next for DocuServe AI
- Add a citizen-facing web portal where users can upload forms and track status.
- Build a voice-based interface for elderly or rural users (integration with Amazon Polly and Lex).
- Connect to e-signature systems for end-to-end submission.
4.Integrate Amazon Q Developer for legal document search and summarization.
- Scale to support state-level legal processes and multilingual filing. Partner with government agencies to run pilot programs for digital governance.
Built With
- amazon-bedrock
- amazon-cloudformation
- amazon-dynamodb
- amazon-iam
- amazon-textract
- amazon-web-services
- aws-cdk
- aws-lambda
- github
- postman
- python
- sagemaker
- typescript
- validation
- visual-studio
Log in or sign up for Devpost to join the conversation.