
Building a Multi-Agent AI Knowledge Management Assistant on AWS with Strands Agents SDK and Amazon Bedrock
An eight-agent enterprise knowledge management pipeline on AWS that automates document ingestion from 8 sources, AI classification across 8 domains, hybrid RAG…An eight-agent enterprise knowledge management pipeline on AWS that automates document ingestion from 8 sources, AI classification across 8 domains, hybrid RAG indexing with Titan Embed v2 + OpenSearch, grounded answer generation, 6-dimension quality review with PII blocking, multi-channel delivery, and continuous KB health scoring with gap analysis.
Building a Multi-Agent AI Knowledge Management Assistant on AWS with Strands Agents SDK and Amazon Bedrock
GitHub: https://github.com/its-me-sweta/Knowledge_Management_AI_Assistant.git
Introduction
Enterprise knowledge is scattered across Confluence, Notion, SharePoint, emails, Slack threads, and people's heads. Finding the right answer to "How do I set up VPN?" or "What's our data retention policy?" can take hours of searching, asking colleagues, or reading outdated documents.
In this post I'll walk through a production-ready, eight-agent AI pipeline that automates the full knowledge lifecycle — from document ingestion to intelligent search, quality review, multi-channel delivery, and continuous gap analysis — using:
- Strands Agents SDK with
@tooldecorators - Amazon Bedrock Nova Pro for classification, summarisation, FAQ generation, and answer synthesis
- Amazon Titan Embed v2 for 1024-dimensional semantic embeddings
- Amazon OpenSearch Serverless for hybrid search (dense kNN + BM25)
- FAISS for in-memory vector index with S3 cold storage
- Amazon Textract for PDF and document extraction
- Amazon Comprehend for NER and language detection
- Amazon DynamoDB for knowledge records, chunks, versions, and audit trail
- Amazon S3 for document storage with KMS encryption
- Amazon EventBridge Scheduler for review reminders and digest scheduling
- Amazon SES + SNS for notifications and multi-channel distribution
- AgentCore Runtime for serverless deployment
Architecture Overview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
┌──────────────────────────────────────────────┐
│ FastAPI / REST Layer │
│ POST /km/request │
│ INGEST|SEARCH|UPDATE|REVIEW|GENERATE|AUDIT │
└──────────────────────┬───────────────────────┘
│
┌──────────────────────▼───────────────────────┐
│ Orchestrator Agent │
│ Request Type · Taxonomy · Quality Gates │
└──────────┬────────────────────────────┬──────┘
│ │
┌──────────────▼──────────┐ ┌─────────────▼──────────────┐
│ Ingestion Agent │ │ Classification Agent │
│ Textract · Confluence │ │ Domain · Type · Audience │
│ Notion · SharePoint │ │ Keywords · Entities · Tags│
│ Dedup · Chunk (512 tok) │ │ AI Summary (Nova Pro) │
└──────────────┬──────────┘ └─────────────┬──────────────┘
└──────────────┬─────────────┘
│
┌──────────────────────────▼───────────────────┐
│ Enrichment Agent │
│ Related Articles · Auto FAQ · TL;DR │
│ Cross-References · Knowledge Graph Links │
└──────────────────────────┬───────────────────┘
│
┌──────────────────────────▼───────────────────┐
│ RAG Indexing Agent │
│ Titan Embed v2 · OpenSearch kNN + BM25 │
│ FAISS · DynamoDB Chunks · Knowledge Graph │
└──────────────────────────┬───────────────────┘
│
┌──────────────────────────────┼──────────────────────────┐
│ │ │
┌───────────▼──────────┐ ┌───────────────▼──────────┐ ┌──────────▼──────────┐
│ Search & Retrieval │ │ Quality Review Agent │ │ Delivery Agent │
│ Semantic + BM25 │ │ Content Quality │ │ Portal Publish │
│ Hybrid RRF │ │ Style Guide · PII Check │ │ SES · Slack │
│ Graph Traversal │ │ Readability · SME Review │ │ Version History │
│ Nova Pro Answer │ │ PASS/WARN/FAIL Verdict │ │ Review Scheduler │
└──────────────────────┘ └───────────────────────────┘ └─────────────────────┘
│
┌─────────────────────────────────────────▼──────┐
│ Knowledge Analytics Agent │
│ Usage Tracking · Gap Analysis · Health Score │
│ Content Recommendations · Weekly Digest │
└────────────────────────────────────────────────┘Stage 1 — Ingestion Agent
Handles 8 source types with a unified extraction pipeline:
1
2
3
4
5
6
7
8
9
10
source_extractors = {
"pdf": "Amazon Textract (async text detection)",
"confluence": "Confluence REST API via Lambda",
"notion": "Notion API via Lambda",
"sharepoint": "Microsoft Graph API via Lambda",
"url": "Puppeteer web scraping via Lambda",
"text": "Direct S3 object read",
"markdown": "Direct S3 object read",
"audio": "Amazon Transcribe",
}Intelligent chunking — 512-token chunks with 50-token overlap:
1
2
3
4
5
def chunk_document(text, document_id, chunk_size_tokens=512, overlap_tokens=50) -> dict:
words_per_chunk = int(chunk_size_tokens * 0.75) # 1 token ≈ 0.75 words
overlap_words = int(overlap_tokens * 0.75)
# Never splits mid-sentence; overlapping chunks preserve contextDuplicate detection using SHA256 fingerprint comparison against the existing KB before processing.
Stage 2 — Classification & Taxonomy Agent
Classifies every article across four dimensions using keyword signals + Nova Pro:
8 Domains: engineering | product | hr | legal | finance | operations | customer | security
9 Document Types: policy | procedure | faq | runbook | tutorial | reference | decision_record | announcement | template
Audience Scoping: all_staff | engineers | managers | executives | customers | external
AI Summary generated by Nova Pro in ≤ 3 sentences — stored alongside the article for search and digest display.
Stage 3 — Enrichment Agent
Adds 6 enrichment layers to every article — all additive, never modifying the original:
Auto FAQ — Nova Pro generates 3–5 Q&A pairs from the content, stored as structured FAQs for direct retrieval.
Knowledge Graph Links:
1
2
relationship_types = ["RELATED_TO", "DEPENDS_ON", "SUPERSEDES", "PREREQUISITE_FOR"]
# Stored as edges in DynamoDB adjacency listTL;DR — 3 bullet points: main point, key action, critical caveat.
Outdated Reference Detection — flags version numbers (v1.x), deprecated tools (Jenkins, SVN), and old dates.
Stage 4 — RAG Indexing Agent
Hybrid indexing strategy for maximum retrieval coverage:
Dense (semantic) index:
1
2
3
4
5
embedding = bedrock.invoke_model(
modelId="amazon.titan-embed-text-v2:0",
body=json.dumps({"inputText": chunk_text, "dimensions": 1024, "normalize": True})
)
# Stored in OpenSearch kNN index + FAISS IVFFlatSparse (keyword) index:
1
2
# BM25 on OpenSearch: title^3, keywords^2, summary^2, content^1
# Effective for error codes, system names, technical termsHybrid retrieval at query time:
1
2
3
4
# Reciprocal Rank Fusion (RRF):
rrf_score = semantic_weight * (1/(rrf_k + semantic_rank))
+ keyword_weight * (1/(rrf_k + keyword_rank))
# Weights: dense=0.7, sparse=0.3Stage 5 — Search & Retrieval Agent
For every knowledge query, the Search Agent runs the full hybrid pipeline and synthesises a grounded answer:
1
2
3
4
5
6
def generate_answer(query_text, top_chunks, question_type) -> dict:
# Context from top-5 reranked chunks
# Nova Pro with strict grounding: "Answer ONLY from the sources"
# Every claim cited with [Source N]
# If no answer found: "I don't have information — contact SME"Access control filters results by the user's role before returning:
1
2
3
4
5
role_access = {
"engineer": ["all_staff", "engineers"],
"manager": ["all_staff", "engineers", "managers"],
"executive": ["all_staff", "engineers", "managers", "executives"],
}Stage 6 — Quality Review Agent
Every article passes a 6-dimension review before publication:
| Dimension | Weight | Key Checks |
|---|---|---|
| Content Quality | 30% | Accuracy, clarity, scope |
| Style Guide | 20% | Active voice, descriptive links, parallel lists |
| Technical Accuracy | 20% | Code syntax, URL validity |
| Completeness | 15% | Title, summary, prerequisites, owner |
| Sensitive Data | BLOCK | PII, API keys, AWS credentials |
| Readability | 15% | Flesch-Kincaid Grade Level ≤ 8 |
Verdict thresholds:
- ≥ 80: PASS → Publish immediately
- 60–79: WARN → Publish with review flag
- < 60: FAIL → Return to author with specific feedback
Sensitive data detection (always BLOCK):
1
2
3
4
5
patterns = {
"api_key": r'(?:sk-|pk-|api[-_]?key[-_]?[:=]\s*)[\w]{20,}',
"aws_key": r'(?:AKIA|ASIA)[0-9A-Z]{16}',
"password": r'(?:password|passwd|pwd)\s*[=:]\s*\S+',
}Stage 7 — Delivery Agent
Publication flow:
- Assign KB Article ID:
KB-2025-A1B2C3 - Publish to S3 (KMS encrypted) + update DynamoDB
- Invalidate CloudFront cache for the article URL
- Record version history (keep last 10 for rollback)
- Notify domain subscribers via SES/SNS
- Sync to Confluence + post to Slack channel
- Schedule review reminder via EventBridge (6 months)
Stage 8 — Knowledge Analytics Agent
KB Health Score (0–100):
1
2
3
4
5
6
kb_health_score = (
coverage_pct * 0.25 + # % of known topics with articles
freshness_pct * 0.25 + # % updated within 6 months
avg_quality_score * 0.25 + # average quality across all articles
search_success * 0.25 # % of queries that found a result
)Gap identification from zero-result queries:
1
2
3
4
5
gaps = [
{"topic": "how to reset MFA", "signal": "zero_results", "priority": "HIGH"},
{"topic": "aws account creation process", "signal": "zero_results", "priority": "HIGH"},
]
# Each gap generates a content recommendation with suggested owner and effort estimateTry It Yourself
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
git clone https://github.com/its-me-sweta/Knowledge_Management_AI_Assistant.git
cd knowledge-management-assistant
pip install -r requirements.txt
uvicorn main:app --reload
# Ingest a document
curl -X POST http://localhost:8000/km/request \
-H "Content-Type: application/json" \
-d '{"request_type":"INGEST","source":"api","submitted_by":"sweta@company.com",
"title":"AWS Account Creation Process",
"content":"# AWS Account Creation\n\nThis guide explains how to request a new AWS account...",
"user_role":"engineer"}'
# Search the knowledge base
curl -X POST http://localhost:8000/km/request \
-H "Content-Type: application/json" \
-d '{"request_type":"SEARCH","content":"How do I create a new AWS account?",
"source":"api","submitted_by":"user@company.com","user_role":"engineer"}'Built with Strands Agents SDK · Amazon Bedrock Nova Pro · AgentCore Runtime
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article