Abdul HaqueHire me
Back to my work
WRK-03 · 2026 · client work

AI Student Companion

A multi-tenant AI study companion. Every client gets their own isolated knowledge, and a student's session stays small and cheap however long it runs.

LangGraphFastAPIpgvectorAzure DevOps
Token cut in RAG90%propositional chunking
Per session100K → 10Ktokens, with smart memory
Load tested5–10concurrent sessions

The idea

The problem

A study assistant needs to know the client's course material, remember the student, and use tools on their behalf. Done naively it sends huge prompts, costs a lot, can leak one client's data to another, and gives every user every tool.

The answer

Retrieval that is isolated per client, chunks that carry one idea each, a memory that keeps only what matters, and tools that are handed out per user instead of globally.

How a message is answered

A LangGraph agent sits in the middle. Everything around it is there to keep the context small, the data separate, and the tools scoped.

REQUESTTOOLSRETRIEVEREMEMBERANSWER
1. REQUEST

A student message arrives for a specific client and user. Audit logging starts here.

2. TOOLS

The tool injector pattern gives the agent only the tools this user is allowed to use.

3. RETRIEVE

pgvector search runs inside the client's own slice of the data, over propositional chunks.

4. REMEMBER

A sliding window with importance scoring keeps what matters and drops the rest.

5. ANSWER

The model replies, with retry and fallback across Groq and Mistral. PII redaction runs on the way out.

The hard parts

Cost, isolation, and trust in one system.

Chunks that carry one idea

Propositional chunking rewrites source text into self-contained statements. It compresses about 10:1 and cut retrieval tokens by 90%.

Memory without the bloat

A sliding window with importance scoring cut a session from about 100K tokens to about 10K, so long conversations stay affordable.

One client never sees another

Per-client isolation in a multi-tenant pgvector store. Retrieval cannot cross the line.

Tools by permission

The tool injector pattern scopes each LLM tool to the user's permissions, plus PII redaction middleware and audit logging for the trail.

Models go down

Retry and fallback across Groq and Mistral, deployed through Azure DevOps CI/CD and load-tested at 5–10 concurrent sessions.

Built with

AgentLangGraph, FastAPI
DataPostgreSQL with pgvector, per-client isolation
ModelsGroq and Mistral with retry and fallback
SafetyPII redaction middleware, audit logging, per-user tool scoping
DeliveryDocker, Azure DevOps CI/CD