Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Build a Document Q&A App with Amazon Bedrock Knowledge Bases and S3 Vectors

Recently, I taught a live session to students at Information Technology University (ITU) in Lahore. The question I opened with was simple: How do you get a reliable answer out of a 200 page PDF without reading the whole thing every time? Ctrl+F finds words. It does not find meaning. And if you paste the whole document into a chat model, you pay for every page on every question, and the model may…

A live session was conducted at Information Technology University (ITU) in Lahore. The session aimed to teach students how to extract reliable answers from lengthy documents without reading the entire content. The solution was Retrieval Augmented Generation (RAG). The app developed for the session, named Poocho AI, allows users to upload PDF, DOCX, or TXT files and ask questions in plain language.

The application then retrieves relevant information from the uploaded files and displays the source page numbers. The architecture of the backend is serverless, utilizing services such as Amazon S3, Amazon SQS, AWS Lambda, Amazon Bedrock Knowledge Bases, Titan Text Embeddings V2, Amazon S3 Vectors, and Amazon Nova Micro. The process begins with a student uploading a file to a presigned URL, which is then stored in S3.

The file is split into chunks, and these chunks are transformed into embeddings using Titan Text Embeddings V2 with 1024 dimensions. These embeddings are stored in an S3 Vectors index, which utilizes cosine distance with float32 values. When a user asks a question, the system retrieves the most relevant chunks from the stored documents, combines them with the user's query, and sends the prompt to the model for generation.

The system ensures that the model only uses information from the relevant chunks, thus avoiding the issue of the model generating information from its own knowledge. The response includes the answer, source file name, and page numbers, enabling users to verify the information's accuracy.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

A link checker says 33 of our 232 outbound links are broken, and a real browser says none of them are

Nakodo has 106 public pages and a lot of citations. Twelve of them compare us to a named competitor and link to that competitor's own pricing page as the source.

  • 33 out of 232 outbound links on Nakodo's website are broken according to a link checker.
  • Link checker reports 33 links returning 403 errors, indicating access is forbidden.
  • Real browser inspection finds none of the 33 links are actually broken or moved.

Test the intersection of search and category filters

A search box can pass its tests while a category filter passes its own, yet the combined interface still returns the wrong set.

  • Test intersection of category and query filters with four records
  • Verify identical results regardless of filter order (category first or query first)
  • Separate saved fixture records from visible search intersections

More from Monday, 30 November 2026 →