RAG & Vector Databases
Retrieval augmented generation, vector embeddings, hybrid search, and semantic indices.
Instruction tuning, structured prompts, context window optimization, and model evaluation.
Subtopics Library
Retrieval augmented generation, vector embeddings, hybrid search, and semantic indices.
Safety alignment, hallucination defense, moderation layers, and enterprise guardrails.
Topic Feed · Prompt Engineering & LLMs
Prompt changes alter context, so regression tests must compare logprob deltas, guardrail hits, and moderation flags across model versions.
Activate provider moderation, set probability thresholds, and layer a custom copyright classifier for comprehensive guardrails.
Real‑time guardrails add ~5‑15 ms latency and cut throughput 3‑12 %, but dramatically lower hallucination and moderation failures.
Use hierarchical table‑aware chunking, hybrid dense‑sparse indexing, and a post‑retrieval merge to keep PDF tables intact in RAG pipelines.
Swap a shadow index via an alias after incremental upserts to achieve zero‑downtime embedding updates.
Metadata filters add fixed cost; tuning efSearch and M in HNSW balances latency and recall per tenant.
Measure hallucinations with recall and LLM factuality scores, then cut them by hybrid search tuning, low‑temp prompts, and a verification layer.
pgvector integrates with Postgres but scales poorly; Pinecone, Qdrant, and Milvus offer distributed, low‑latency hybrid search with varying deployment models.
Combine Pinecone vector search with Neo4j graph traversal, then fuse scores (α≈0.6) to retrieve relational entity context for RAG.
Enforce strict JSON output by pairing a JSON schema with low temperature, function‑calling, and post‑validation retries.
Hierarchical chunking, dynamic token budgeting, and selective retrieval keep reasoning strong within 128k+ token prompts.
Chain‑of‑Thought adds modest latency while noticeably raising logical accuracy on complex tasks.
Few-shot prompting delivers near‑fine‑tune quality at zero training cost by using a small, token‑budgeted exemplar set and deterministic API settings.
Cut latency by using smaller instruction‑tuned models, cache system prompts, adopt structured JSON prompts, enable streaming with chunked pre‑fill, and apply 4‑bit quantization.
Meta‑prompts generate on‑the‑fly prompts; DSPy runs differentiable optimization to find the highest‑scoring prompt variant under a call budget.