How aakash1999/awsbedrockrag works
This is a single-file command-line RAG demo. Running it invokes main, which embeds a fixed query and six in-memory documents through Amazon Bedrock, ranks the documents by cosine similarity, then sends the top matches as grounded context to a text-generation model and prints the answer. The retrieval and generation stages are separate functions in the same file; there is no persistent index or user-facing service. The graph reflects the sampled source; AWS is an external dependency.
Main entry points: rag_demo.py CLI entry point
Components 8
RAG demo
- CLI entry point
rag_demo.py - Sample documents
rag_demo.py - Semantic retrieval
rag_demo.py - Cosine scoring
rag_demo.py - Grounded generation
rag_demo.py - Printed results
rag_demo.py
Other components
- Demo user
- Bedrock Runtime
Connections 8
- Demo user → CLI entry point: runs
rag_demo.py - CLI entry point → Sample documents: uses
rag_demo.py - CLI entry point → Semantic retrieval: calls
rag_demo.py - Semantic retrieval → Bedrock Runtime: requests embeddings
rag_demo.py - Semantic retrieval → Cosine scoring: scores vectors
rag_demo.py - CLI entry point → Grounded generation: calls
rag_demo.py - Grounded generation → Bedrock Runtime: requests completion
rag_demo.py - CLI entry point → Printed results: prints
rag_demo.py