DEV Community

Cover image for Sample RAG app with Strands, Reflex and S3
Shakir for AWS Community Builders

Posted on

Sample RAG app with Strands, Reflex and S3

Hi πŸ‘‹, these are some setup instructions for the app that lets store some notes for subjects πŸ“š in S3 as vectordb and query it with Strands. You may checkout the code here.

First goto S3 >> Vector buckets, and create a vector bucket there and give it some name such as studynotes.

Create an index there with dimension 1024, this is going to be the size of the embedding vector.

Let's now clone the app and switch the directory.

git clone https://github.com/networkandcode/studynotes.git
cd studynotes
Enter fullscreen mode Exit fullscreen mode

So we now have the following for our .env file, add it here.

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION="us-west-2"
AWS_S3_VECTOR_BUCKET_NAME=studynotes
AWS_S3_VECTOR_INDEX_NAME=books
Enter fullscreen mode Exit fullscreen mode

⚑ Run the app with uv/reflex.

uv run reflex run

Creating virtual environment at: .venv

App running at: http://localhost:3000/
Backend running at: http://0.0.0.0:8000
Enter fullscreen mode Exit fullscreen mode

You can now access the app at http://localhost:3000/.

A few screenshots below.

Home page

Home page

Subjects

Subjects page

Upload notes

Notes page

Chat

Chat page

Ok, so that's it for the post. This was done mainly to see how we can use S3 vector with python for RAG. The code related to S3 vector operations is in this file. The app may not be perfect yet, needs some improvement.

Top comments (0)