AWS Builder Center
Beyond RAG: Building an AI Regulatory Intelligence System That Understands Documents, Rules, and Relationships

Beyond RAG: Building an AI Regulatory Intelligence System That Understands Documents, Rules, and Relationships

Regulatory documents contain clauses, obligations, exceptions, and amendments that must be understood together. This article explores a proposed AWS-based Regulatory Intelligence System that goes beyond traditional RAG using document processing, hybrid retrieval, knowledge graphs, and generative AI. Discover its architecture, AWS services, practical implementation, and a BIS standards use case focused on traceability, version control, and evidence-backed answers.

Beyond RAG: Building an AI Regulatory Intelligence System That Understands Documents, Rules, and Relationships
  1. Introduction: Regulatory information is not just text
Imagine an organization preparing to launch a product in a regulated market.
A compliance professional may need to answer questions such as:
  • Which standard applies to this product?
  • Which clauses define the mandatory requirements?
  • Has the relevant standard been amended or replaced?
  • Does another standard reference the same requirement?
  • Are there exceptions, conditions, or dependencies?
  • What evidence supports the conclusion?
Finding a paragraph is only the first step. Understanding how that paragraph connects to other clauses, definitions, amendments, and standards is the harder problem.
This is where traditional document search and basic Retrieval-Augmented Generation (RAG) can fall short.
A conventional RAG application retrieves relevant document chunks and provides them to a language model to generate an answer. This works well for many question-answering tasks. However, regulatory questions often require reasoning across multiple documents and understanding explicit relationships between rules.
What if an AI system could do more than retrieve a paragraph? What if it could identify the applicable clause, trace its dependencies, understand amendment history, and explain the answer with verifiable evidence?
That is the idea behind an AI Regulatory Intelligence System.
In this article, we will explore a proposed architecture using AWS services to combine document intelligence, hybrid retrieval, knowledge graphs, and generative AI.
«Architecture and implementation disclosure: This is a proposed technical reference architecture and implementation guide. It is not a report of a completed AWS deployment. The example workflow, data structures, and outputs are illustrative; no production performance or accuracy results are claimed.»
  1. Why traditional RAG is not always enough
A typical RAG pipeline follows a straightforward process:
  1. Upload documents.
  1. Extract text.
  1. Split text into chunks.
  1. Generate embeddings.
  1. Store embeddings in a vector database.
  1. Retrieve relevant chunks for a user query.
  1. Pass the retrieved context to an LLM.
  1. Generate an answer.
This approach is useful, but regulatory information introduces additional challenges.
Challenge 1: Relationships across documents
Consider a hypothetical standard containing:
  • Clause 4.1: General requirements
  • Clause 4.2: Product classification
  • Clause 5.1: Testing procedure
  • Clause 6.1: Safety requirements
Clause 5.1 may refer to Clause 4.2, while Clause 6.1 may depend on a definition elsewhere in the document.
A similarity search may retrieve the right paragraph without necessarily identifying all the connected requirements.
Challenge 2: Amendments and version control
Regulatory documents change over time. An amendment may modify one clause without replacing the entire standard.
A system must distinguish between:
  • Original publications
  • Amendments
  • Corrigenda
  • Revisions
  • Withdrawn or superseded editions
  • Currently applicable versions
Without version-aware retrieval, an AI system could return a technically relevant but outdated requirement.
Challenge 3: Exact clause identification
Regulatory queries frequently contain identifiers such as:
  • IS 1234:2025
  • Clause 5.2.1
  • Amendment No. 1
  • Annex B
Semantic similarity alone may not be sufficient for exact identifier matching. Keyword and structured filtering are important.
Challenge 4: Evidence and traceability
A regulatory answer should not simply sound convincing. It should show:
  • The source document
  • The exact clause or section
  • The edition or amendment
  • The relevant source passage
  • The reasoning used to connect the evidence
This is essential for human verification.
The solution is not to discard RAG. It is to extend retrieval with document structure, metadata, graph relationships, and validation.
  1. Proposed system architecture
The proposed system has five major layers:
  1. Document ingestion and processing
  1. Regulatory knowledge extraction
  1. Hybrid retrieval and knowledge graph
  1. AI reasoning and response generation
  1. Evidence, security, and monitoring
Layer 1: Document ingestion and processing
The pipeline begins when a user or authorized administrator uploads a regulatory document.
Possible input sources include:
  • BIS standards and guidelines
  • Technical regulations
  • Product certification documents
  • Amendments and corrigenda
  • Government notifications
  • Compliance manuals
Proposed AWS services:
AWS service| Responsibility Amazon S3| Store original documents and processed artifacts Amazon EventBridge| Initiate processing when an upload event is received AWS Step Functions| Orchestrate multi-stage document processing AWS Lambda| Perform validation, metadata extraction, and transformation Amazon Textract| Extract text, tables, forms, and layout information from supported scanned documents Amazon Bedrock| Assist with structured information extraction and document classification
A practical ingestion workflow:
  1. Upload the PDF to an S3 source bucket.
  1. Record its source, publication date, document identifier, and version.
  1. Detect whether it contains selectable text or scanned pages.
  1. Extract native PDF text using a suitable PDF parser.
  1. For scanned documents, use Amazon Textract where appropriate.
  1. Normalize the extracted content while preserving page and section boundaries.
  1. Identify headings, clause numbers, tables, definitions, and references.
  1. Store the extracted content and processing metadata in S3.
An important design decision is to preserve the original document. Never treat extracted text as a replacement for the authoritative source.
For every extracted clause, retain a reference to the original document and its page or section location.
Layer 2: Regulatory knowledge extraction
This is where the system begins moving beyond basic document search.
Instead of storing only paragraphs, the application attempts to identify meaningful regulatory entities and relationships.
For example, a document may contain:
  • Standard: IS 1234:2025
  • Clause: 5.2.1
  • Requirement: A product must satisfy a specified testing condition
  • Definition: A technical term used by the requirement
  • Reference: Clause 4.3
  • Amendment: Amendment No. 1
The extraction pipeline can transform these elements into structured records.
Illustrative clause representation:
{ "standard_id": "IS-1234-2025", "clause_id": "5.2.1", "title": "Testing Requirements", "requirement_type": "mandatory", "text": "Illustrative extracted requirement text", "page": 18, "edition": "2025", "status": "under_review", "source_document": "IS-1234-2025.pdf" }
This is an example application schema, not an AWS Textract response format or an actual BIS clause.
The extraction process should identify entities such as:
  • Standards
  • Clauses and subclauses
  • Definitions
  • Requirements
  • Exceptions
  • Products and product categories
  • Testing methods
  • Amendments
  • Referenced standards
It should also identify relationships such as:
  • "CONTAINS"
  • "REFERENCES"
  • "DEFINES"
  • "AMENDS"
  • "SUPERSEDES"
  • "DEPENDS_ON"
  • "APPLIES_TO"
  • "EXEMPTS"
These relationships form the foundation of the regulatory knowledge graph.
Crucially, the system should distinguish between an explicit relationship found in the document and a relationship inferred by an AI model. Inferred relationships should carry confidence information and require validation before being treated as authoritative.
Layer 3: Hybrid retrieval and knowledge graph
A regulatory intelligence platform should not depend on one retrieval strategy.
The proposed architecture combines three complementary approaches.
A. Keyword retrieval
Keyword retrieval is useful for exact identifiers and terminology.
For example:
  • IS 1234:2025
  • Clause 5.2.1
  • Amendment No. 2
  • A specific technical term
Amazon OpenSearch Service can support lexical search and structured filtering.
B. Semantic retrieval
Semantic retrieval helps understand the meaning behind a question.
For example:
"What safety conditions must a manufacturer consider before testing this product?"
The user may not mention the exact wording used in the standard. Vector search can help locate conceptually relevant passages.
Amazon Bedrock Knowledge Bases can provide managed RAG capabilities. Depending on the selected configuration, the application can use supported vector stores and retrieval options.
Amazon OpenSearch Serverless is another option for vector search and hybrid search architectures.
C. Graph-based retrieval
Some regulatory questions require understanding connections rather than simply finding similar text.
Consider this illustrative graph:
IS 1234:2025 | | CONTAINS v Clause 5.2.1 | | REFERENCES v Clause 4.3 | | USES_DEFINITION v Definition 2.1
Amendment No. 1 | | AMENDS v Clause 5.2.1
A graph can help the application discover related clauses, definitions, and amendment records.
For a managed AWS approach, Amazon Bedrock Knowledge Bases supports GraphRAG with Amazon Neptune Analytics. This combines vector retrieval with graph-based expansion of related information.
Alternatively, a custom graph pipeline can be built when the application requires more control over its ontology, validation rules, relationship types, and traversal logic.
The key distinction is:
  • Vector retrieval finds relevant content by similarity.
  • Keyword retrieval finds exact terms and identifiers.
  • Graph retrieval explores connections between entities.
Combining them provides a stronger foundation for complex regulatory questions.
Layer 4: AI reasoning and response generation
The orchestration layer receives the user's question and determines which information is needed.
A possible workflow:
  1. Classify the question.
  1. Extract standard numbers, clause references, product types, and dates.
  1. Determine whether the question requires exact search, semantic search, graph traversal, or a combination.
  1. Retrieve relevant clauses.
  1. Expand the results through related graph entities.
  1. Apply version and applicability filters.
  1. Assemble source passages and evidence.
  1. Send the evidence to an Amazon Bedrock foundation model.
  1. Validate the response structure and citations.
  1. Return the answer with source references.
For example, the system could classify questions into categories:
Question type| Retrieval strategy Exact clause lookup| Keyword + metadata filtering Concept explanation| Semantic retrieval Related requirements| Graph traversal + semantic retrieval Amendment comparison| Version-aware document comparison Product applicability| Structured rules + graph retrieval Compliance assessment| Evidence retrieval + deterministic validation + human review
The model should not be asked to independently invent regulatory applicability rules.
Where a rule is deterministic, such as a date comparison or an explicitly defined threshold, application code should evaluate it. The LLM can explain the result using retrieved evidence.
Layer 5: Evidence, security, and monitoring
A regulatory system should be designed around traceability.
Every answer should ideally contain:
  • Document title and identifier
  • Edition or version
  • Clause number
  • Page number
  • Quoted or clearly identified supporting passage
  • Amendment status
  • Retrieval timestamp
  • Any unresolved ambiguity
Amazon Bedrock Guardrails can help apply configured safeguards, including prompt-attack detection and sensitive-information controls.
Other proposed controls include:
  • Amazon Cognito for user authentication
  • AWS IAM for service-level permissions
  • AWS KMS for encryption key management
  • Amazon CloudWatch for logs, metrics, and alarms
  • S3 versioning and controlled document access
  • Audit records for document changes and administrative actions
Security must also extend to the retrieval layer. A user should only retrieve documents and records they are authorized to access.
  1. AWS technology mapping
The following is one possible service mapping for the proposed system. The final selection depends on scale, region availability, document formats, cost, and operational requirements.
Requirement| Proposed AWS technology Original document storage| Amazon S3 Upload event handling| Amazon EventBridge Workflow orchestration| AWS Step Functions Serverless processing| AWS Lambda Scanned document extraction| Amazon Textract Foundation models| Amazon Bedrock Managed RAG| Amazon Bedrock Knowledge Bases Graph-based retrieval| Amazon Neptune Analytics GraphRAG Custom lexical/vector search| Amazon OpenSearch Serverless User authentication| Amazon Cognito Encryption| AWS KMS Monitoring| Amazon CloudWatch
Important architecture choice: Amazon Bedrock Knowledge Bases with Neptune Analytics GraphRAG is a managed option for combining graph and vector retrieval. A custom Neptune-based knowledge graph is a separate design choice when more control over the graph schema and regulatory rules is required. These approaches should not be treated as identical or automatically interchangeable.
  1. Practical implementation: A phased approach
Rather than attempting to build the entire platform at once, the system can be developed incrementally.
Phase 1: Create the document repository
Create an S3 bucket structure such as:
regulatory-intelligence/ │ ├── raw-documents/ │ ├── standards/ │ ├── amendments/ │ └── guidelines/ │ ├── extracted-content/ │ ├── normalized-clauses/ │ ├── metadata/ │ └── evaluation-datasets/
Enable versioning and configure access controls. Keep original documents separate from generated processing artifacts.
Phase 2: Extract and normalize document content
For native PDFs, a Python parser such as PyMuPDF can extract selectable text and page information.
For scanned PDFs and image-based documents, use Amazon Textract for supported extraction workflows.
A simplified Python example for native PDF extraction:
import fitz
def extract_pdf_pages(pdf_path): document = fitz.open(pdf_path) pages = []
for page_number, page in enumerate(document, start=1):
text = page.get_text("text")

pages.append({
"page_number": page_number,
"text": text.strip()
})

return pages
pages = extract_pdf_pages("sample_standard.pdf")
for page in pages: print(f"Page {page['page_number']}") print(page["text"])
This is a starting point for native PDFs. It does not perform OCR or reliably identify every clause boundary. A separate normalization stage is needed to detect headings, tables, clause hierarchies, and references.
Phase 3: Build structured clause records
Transform extracted content into records that preserve the document hierarchy.
For example:
clause = { "document_id": "IS-1234-2025", "clause_id": "5.2.1", "parent_clause": "5.2", "title": "Testing Requirements", "page_number": 18, "edition": "2025", "source_file": "IS-1234-2025.pdf", "extraction_status": "pending_review" }
The application can then validate:
  • Whether the clause identifier exists
  • Whether its parent clause exists
  • Whether the page reference is valid
  • Whether the source document is known
  • Whether the edition metadata is complete
Do not silently discard records that fail validation. Store them for correction.
Phase 4: Create the retrieval layer
A practical first implementation can begin with Amazon Bedrock Knowledge Bases.
The developer can:
  1. Prepare normalized documents.
  1. Attach document-level metadata.
  1. Configure the knowledge base and supported vector store.
  1. Synchronize the data source.
  1. Retrieve relevant passages using the knowledge base APIs.
  1. Return source attribution with the generated response.
For more demanding exact-identifier searches, add an OpenSearch lexical index or use a configured hybrid-search approach.
Useful metadata fields include:
{ "document_id": "IS-1234-2025", "edition": "2025", "document_type": "standard", "clause_id": "5.2.1", "publication_date": "2025-01-01", "document_status": "active", "jurisdiction": "IN" }
These values are illustrative. In production, document status and applicability must come from authoritative records and validated governance processes.
Phase 5: Add graph relationships
For a managed approach, evaluate the GraphRAG capability in Amazon Bedrock Knowledge Bases with Neptune Analytics.
For a custom approach, define a graph schema and populate it from validated clause records.
A simplified conceptual model:
(Standard)-[:CONTAINS]->(Clause) (Clause)-[:REFERENCES]->(Clause) (Clause)-[:USES_DEFINITION]->(Definition) (Amendment)-[:AMENDS]->(Clause) (NewEdition)-[:SUPERSEDES]->(OldEdition) (ProductCategory)-[:SUBJECT_TO]->(Standard)
A graph relationship should retain its provenance: the source document, page, clause, extraction method, and validation status.
This makes it possible to inspect why two regulatory entities are connected.
Phase 6: Build the question-answering API
A backend API can receive the user's question and coordinate retrieval.
A simplified Python-style orchestration example:
def answer_regulatory_question(question): query_type = classify_question(question)
exact_results = keyword_search(question)

semantic_results = semantic_search(question)

if query_type in [
"related_requirements",
"amendment_impact",
"cross_document_reference"
]:
graph_results = graph_search(question)
else:
graph_results = []

evidence = merge_and_rank(
exact_results,
semantic_results,
graph_results
)

evidence = apply_version_and_access_filters(evidence)

if not evidence:
return {
"status": "insufficient_evidence",
"answer": (
"I could not find sufficient verified "
"regulatory evidence to answer this question."
),
"sources": []
}

response = generate_grounded_answer(
question=question,
evidence=evidence
)

return validate_citations(response, evidence)
The functions in this example represent application components that must be implemented and connected to the selected AWS services. This is architectural pseudocode, not a ready-to-run AWS SDK implementation.
A production implementation should also include retries, timeouts, structured error handling, authorization checks, request tracing, and model evaluation.
  1. Real-world use case: BIS standards intelligence
Consider a hypothetical manufacturer that wants to understand the regulatory requirements relevant to a product.
A compliance professional asks:
"Which requirements in the applicable standard relate to product safety, and have any of those requirements been changed by an amendment?"
A conventional RAG application might retrieve a few passages containing the words "product safety" and "amendment."
The proposed Regulatory Intelligence System would take a more structured route.
Step 1 — Identify the entities
The system identifies the product category, standard identifier, relevant clauses, and requested date or edition.
Step 2 — Retrieve authoritative documents
It retrieves the relevant standard, amendments, and supporting guidance using exact identifiers, metadata filters, and semantic search.
Step 3 — Explore relationships
The graph retrieval component checks which clauses are referenced, which definitions they depend on, and whether an amendment is linked to those clauses.
Step 4 — Apply version logic
The system compares the publication and effective dates available in the source records. It avoids assuming that the newest uploaded file is automatically the applicable version.
Step 5 — Generate an evidence-backed explanation
An illustrative response could look like this:
"Based on the indexed documents, the following clauses appear relevant to the requested safety topic. Clause references and amendment relationships are listed below for review. The system could not establish applicability for one referenced requirement because the authoritative status record was missing."
The answer would include a table of source documents, clause identifiers, page references, amendment links, and verification status.
Step 6 — Human verification
A qualified compliance professional reviews the cited source material before relying on the result for certification, product release, or a regulatory submission.
This is the important difference: the system supports regulatory research and decision-making; it does not automatically become the legal or regulatory authority.
  1. How should we evaluate the system?
A regulatory AI application should be evaluated on more than whether its answers sound natural.
Suggested evaluation dimensions:
Evaluation area| What to measure Retrieval quality| Precision@K, Recall@K, and relevant-clause retrieval Citation quality| Whether citations point to the correct source and passage Version accuracy| Whether the correct edition and amendment are retrieved Graph quality| Accuracy of extracted entities and relationships Answer grounding| Whether each factual claim is supported by evidence Abstention quality| Whether the system declines to answer when evidence is insufficient Security| Whether unauthorized documents are excluded from retrieval Operational performance| Latency, failure rate, and processing cost
Create a manually reviewed evaluation dataset containing realistic questions, expected source clauses, applicable versions, and known amendment relationships.
For example, test questions should include:
  • Exact clause lookup
  • Questions involving two or more standards
  • Questions about amendment history
  • Questions containing outdated document identifiers
  • Questions with ambiguous product descriptions
  • Questions for which the document repository has no sufficient answer
A particularly important test is whether the system can say, "I don't have enough verified evidence."
  1. Challenges and engineering considerations
Document quality
Scanned pages, unusual layouts, tables, diagrams, and poor OCR can introduce errors. Preserve page-level provenance and provide a review process for uncertain extractions.
Amendment complexity
An amendment may change only part of a clause. Model changes at the smallest reliable unit and retain the relationship between the original text and the amended text.
False relationships
An LLM may infer a connection that is not explicitly supported by a source. Store relationship provenance and distinguish extracted facts from model-generated hypotheses.
Retrieval security
Authorization must be enforced before evidence reaches the model. Filtering only after generation is not sufficient.
Prompt injection in documents
Uploaded documents should be treated as untrusted data, not as instructions. Apply input and output safeguards, isolate system instructions from retrieved content, and test malicious or misleading document text.
Cost and latency
OCR, embedding generation, graph construction, retrieval, and model inference all contribute to operating cost. Use asynchronous processing for large documents, cache suitable results, and select model sizes based on evaluation rather than assumption.
Human accountability
Regulatory conclusions can have legal, financial, and safety consequences. The system should assist experts, show evidence, and make uncertainty visible—not silently make high-impact decisions.
  1. What makes this architecture different?
The main innovation is not simply adding a knowledge graph to a chatbot.
It is treating regulatory information as a connected, versioned, evidence-bearing knowledge system.
The proposed architecture combines:
  • Document intelligence for extracting structured information
  • Hybrid search for exact and semantic retrieval
  • Knowledge graphs for navigating regulatory relationships
  • Deterministic validation for dates, identifiers, and explicit rules
  • Generative AI for explaining retrieved evidence
  • Human review for consequential decisions
This approach can also be adapted to other domains, including financial regulations, healthcare standards, environmental compliance, industrial safety, and government policy research.
  1. Conclusion: From document search to regulatory intelligence
RAG made it easier to connect language models with organizational knowledge. But in complex regulatory environments, retrieving a relevant paragraph is not the same as understanding the rule.
A more capable system must know where the information came from, which version it belongs to, what it references, how it has changed, and whether the available evidence is sufficient to support an answer.
AWS provides building blocks for this direction—from Amazon S3 and Textract to Amazon Bedrock, OpenSearch, and Neptune Analytics.
The proposed architecture demonstrates how these services can be combined to create a regulatory intelligence platform that is more traceable, relationship-aware, and useful for expert workflows.
The next evolution of RAG is not just retrieving better answers. It is building systems that can explain how the evidence, rules, and relationships fit together.
References and further reading
  1. "Amazon Bedrock Knowledge Bases documentation" ( https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html )
  1. "Build a knowledge base with Amazon Neptune Analytics graphs" ( https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-graphs.html )
Disclaimer: This article describes a proposed architecture for technical exploration. It is not an official AWS reference architecture, a deployed implementation report, or regulatory advice. Always verify regulatory requirements against the applicable official publications and consult qualified professionals.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article