The problem
Prompt advice is scattered across guides and papers, and iteration usually happens in a scratch file with nothing retained. The design answer was to make the improvement itself retrieval-grounded - the optimiser cites a real corpus rather than the model's own habits - and to parse the output deterministically from tag-delimited fields, so the prompt, its rationale and its checklist are separable data rather than prose to re-read.
What I built
- Implemented a RAG layer ingesting Markdown guides, arXiv papers and PDFs into a 384-dimension Pinecone serverless index, with recursive 1,000-character chunking, 200-character overlap and batched upserts using all-MiniLM-L6-v2 embeddings.
- Designed a structured meta-prompting engine applying a five-step Task–Context–References–Evaluate–Iterate framework, with tag-delimited LLM output parsed deterministically into optimised prompt, rationale and checklist fields.
- Built a persona system with eight seeded role templates and user-owned custom personas, composing persona instructions into system context for both optimisation and chat, with per-user ownership scoping and an active-persona default.
- Implemented HS256 JWT authentication with PBKDF2-SHA256 password hashing over a six-table SQLAlchemy/PostgreSQL schema covering users, profiles, personas, prompts, chat sessions and analytics, with full CRUD REST APIs for a searchable prompt library.
- Added a windowed in-memory chat session store retaining the last 20 messages per session, enabling an optimise → test → refine loop against the generated system prompt.
Stack
PythonFastAPIUvicornPydanticSQLAlchemyPostgreSQLAlembicpython-josePasslibLangChainGroq API (Llama 3.3 70B)Pineconesentence-transformersPyPDFUnstructuredReact 18ViteReact RouterAxios
Skills applied
- RAG pipeline design
- Vector search and embedding models
- Meta-prompt engineering
- Structured LLM output parsing
- Relational schema design
- JWT authentication and password hashing
- Document ingestion and chunking strategy
- REST API development
- Persona-based prompt testing
- Frontend state management with React Context