Claude

We all know Claude

We all have a love-hate relationship
with Claude, or any AI service

Common issues

Hallucinations

Can you update the auth middleware?

J

Done! Updated src/middleware/auth.ts on line 47.

That file literally does not exist

J

You're right, I apologize. I hallucinated that path entirely.

Confident. Specific. Completely wrong.
Context loss
monday 14:32

"We use Supabase with RLS, deploy on Cloudflare Workers, auth is JWT with refresh tokens, the API prefix is /v1..."

+847 messages 4.5 hours
session ended
tuesday 09:15

"Continue where we left off"

I'd be happy to help! Could you give me some context about what we're working on?

4.5 hours of context. Gone in one refresh.
Memory

I remember you prefer Tailwind and use npm, not yarn.

Great! What port is our dev server on?

J

I believe it's port 3000?

4321. You configured it yourself last week.

J
Remembers vibes Forgets specifics
Improving. But not there yet.

The assignment

Build a centralised hub where you can
monitor, manage, and extract information
with Claude

Sounds simple, right?

What that actually means

A graphical database you can monitor in real time

Edit and change data when needed

Role-based permissions for who can view, edit, and approve

Semantic search, not keyword-based. Vectors, embeddings, nodes, edges and more

99.99% accuracy by grounding Claude in verified data

Fast, centralized hub with its own embedded memory layer

Well, let me break it down for you.

The math behind it

cos(θ) = A · B / (||A|| · ||B||)

∇L(θ) = -∑ log P(wt | wctx)

softmax(zi) = ezi / ∑ ezj

sim(q, d) = ∑ wi · tf-idf(ti)

d(p, q) = √∑(pi - qi

E(x) = Wex + Wp

?

I will keep it simple.

Layer 1

pgvector

Vectors and embeddings

You start with a file

knowledge_base.txt

The new API gateway handles 2,400 requests per minute.

Authentication uses JWT with refresh token rotation.

Project X launch has been moved to November.

Design for Project X was approved by marketing.

Team standup moved to 10:00 on Tuesdays.

We pick one sentence

Project X launch has been moved to November.

Split into words

Project X launch has been moved to November

Each word becomes a number

Project 0.23
X -0.11
has 0.87
been -0.45
moved 0.62
to -0.08
launch 0.34
November 0.91

In reality: 768 numbers per sentence

Together, this is a vector

[ 0.23, -0.11, 0.87, -0.45, 0.62, ... ]

A list of numbers that captures meaning

"What is the status of Project X?"

launch November
design approved
project lead
JWT refresh tokens
kapsalon friday
query
0.91
0.84
match
unrelated
very unrelated

pgvector says

"What is the status of Project X?"

0.91

Project X launch has been moved to November

0.84

Design for Project X was approved by marketing

0.79

Max is lead developer on Project X

0.12

Kapsalon friday

"These probably belong together."

pgvector knows they are similar.
But it does not know why.

That is where Layer 2 comes in.

Layer 2

Apache AGE

Nodes, edges, relationships

Same data, different question

pgvector asks: "what looks similar?"

AGE asks: "what is connected to what?"

A local LLM reads the text and extracts entities

Project X launch has been moved to November. Design approved by Marketing. Max is lead developer.

Project X moved November Design Marketing Max

These entities become nodes

Project X
November
Date
Design
Resource
Marketing
Department
Max
Person
MOVED_TO LEAD_DEV HAS_DESIGN APPROVED_BY Project X Project November Date Max Person Design Resource Marketing Department

Now AGE can answer

Project X —MOVED_TO→ November

Project X —LEAD_DEV→ Max

Project X —HAS_DESIGN→ Design —APPROVED_BY→ Marketing

Not just "similar". Now we know the structure.

Together

Layer 1

pgvector

"These items are semantically related"

Layer 2

Apache AGE

"And here is exactly how they connect"

One more layer to go.