# How I Built a Personal AI Knowledge Base with Amazon Aurora pgvector and Next.js — AWS H0 Hackathon

> Source: <https://dev.to/hamzanabdev/how-i-built-a-personal-ai-knowledge-base-with-amazon-aurora-pgvector-and-nextjs-aws-h0-hackathon-19jf>
> Published: 2026-06-26 23:25:05+00:00

I built ChatScroll for the AWS H0 Hackathon — an app that

lets you save AI answers as searchable "Scrolls" using

Amazon Aurora PostgreSQL with pgvector for semantic search.

Every day people ask AI assistants valuable questions and

get great answers — then lose them forever. Chat history

is linear, unsearchable, and ephemeral. I kept re-Googling

the same questions knowing I had already found the answer

somewhere but couldn't find it again.

ChatScroll transforms AI conversations into a personal

knowledge library. Save any AI answer as a "Scroll",

organize it automatically, and find it later with

semantic search.

Making search understand MEANING not just keywords. When

you search "blood thinner medication" it should find your

warfarin scroll even though "blood thinner" doesn't appear

in the title.

Amazon Aurora PostgreSQL with the pgvector extension stores

3072-dimensional vector embeddings for every saved Scroll.

When a user saves a Scroll:

When a user searches:

``` js
-- Semantic search with threshold
WHERE 1 - (embedding <=> $queryVec) > 0.5
ORDER BY embedding <=> $queryVec
LIMIT 5
```

What makes Aurora special for this use case is three

extensions working together:

**pgvector** — stores 3072-dim embeddings, enables cosine

similarity search between vectors

**ltree** — stores folder paths as dot-separated label trees

(`programming.containers`

), enables subtree queries without

recursive CTEs

**tsvector** — powers full-text search with ranking via

ts_rank, combined with pgvector for hybrid search

I made a deliberate choice to use TWO AWS databases:

**Amazon Aurora PostgreSQL** for structured data:

**Amazon DynamoDB** for chat messages:

This separation keeps Aurora lean for complex queries

while DynamoDB handles the high-volume chat stream.

Searching "containerization technology" correctly surfaces

the Docker scroll. Searching "blood thinner medication"

finds warfarin — no programming results contaminating it.

Semantic search scoped to the same folder category

ensures results are always relevant.

Live app: [https://chatscroll.vercel.app](https://chatscroll.vercel.app)

AWS Architecture: [https://chatscroll.vercel.app/aws-showcase](https://chatscroll.vercel.app/aws-showcase)

I created this content for the purposes of entering

the AWS H0 Hackathon.
