Waking up at 3 AM during an outage is already rough. Now imagine also having to write optimized SQL against a table with 100+ fields and billions of rows. All while sleep-deprived, under pressure, clock ticking. That's the problem we set out to fix. We built a Claude skill for CDN analytics that lets practitioners ask questions in plain English and get back correct SQL, accurate results, and interactive visualizations—no deep knowledge required. A prompt like "review CDN performance for the past 12 hours and flag any issues" returns a full dashboard: cache hit ratio, error rates, P99 latency, and bandwidth trends that you ca act on immediately. Generic AI + schema access (basic MCP) isn't enough. LLMs make predictable mistakes with complex data models. You have to encode the expertise—the right tables, query patterns, and common pitfalls—so AI has what it needs before it writes a single line of SQL. With the right skills, you can harness engineering knowledge, available any time, at 3 AM or any other hour. Read our latest post from Dan Sullivan to learn more. https://hubs.la/Q0444-xc0
SQL Made Easy with Claude Skill for CDN Analytics
More Relevant Posts
-
A "SQL Snippet" is not a Data Pipeline. There’s a lot of noise lately about LLMs writing SQL. It’s a great productivity hack for a sandbox, but "Code-Gen" is only 5% of the journey to Production-Ready. A real data pipeline requires: ▪️ Automated Error Handling. ▪️ Downstream Guardrails. ▪️ Performance Tuning. ▪️ Secure Deployment. If you have to manually take "AI-generated code" and then spend days testing and deploying it, you are still in a rebuild exercise. A true Generative Data Pipeline handles the entire lifecycle. It takes you from "Intent" to "Production" in one motion. If it’s not actionable and governed, it’s just more noise in the stack. #GenerativeAI #DataEngineering #DataPipelines #AI hashtag#Innovation
To view or add a comment, sign in
-
𝗥𝗔𝗚 𝗶𝘀 𝗲𝗮𝘀𝘆. 𝗛𝗶𝗴𝗵-𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲 𝗥𝗔𝗚 𝗶𝘀 𝗵𝗮𝗿𝗱. Most "Talk to your Data" bots fail when they hit the real world databases. Why? Because developers treat Retrieval-Augmented Generation (RAG) like a magic feeding all the documents without considering chunking strategy, embeddings and context window of Models. If you're building a Prompt-to-SQL engine, a single hallucination isn't just a "bad chat"—it’s a broken database query. After architecting these systems, here are the non-negotiables for a RAG: 𝗧𝗵𝗲 𝗖𝗵𝘂𝗻𝗸𝗶𝗻𝗴 𝗦𝘁𝗿𝗮𝘁𝗲𝗴𝘆 Don't just split by character count. That’s how you lose context. ✅ DO: Use Structure-Aware Chunking. One Table = One Chunk. ❌ DON'T: Split a table's DDL across two chunks. The LLM won't see the columns it needs to JOIN. ⚠️ The Risk: Broken queries. If the LLM doesn't see the Foreign Key in the current chunk, it can’t link your data. 𝗘𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀 & 𝗥𝗲𝘁𝗿𝗶𝗲𝘃𝗮𝗹 Dimensions: High dimensionality (1536+) is great for nuance, but overkill for simple schemas. Match your model to your domain. Top-K: Don't be greedy. ✅ DO: Aim for K=3 to 5 relevant tables. ❌ DON'T: Set K too high. You’ll hit the "Lost in the Middle" phenomenon where the LLM ignores the most relevant schema info. 𝗟𝗟𝗠 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗮𝘁𝗶𝗼𝗻: 𝗧𝗵𝗲 "𝗭𝗲𝗿𝗼" 𝗥𝘂𝗹𝗲 ✅ DO: Set Temperature to 0. SQL generation requires precision, not "creativity." ❌ DON'T: Use high temperature. You don't want your AI "inventing" a more poetic way to write a SELECT statement. 𝗛𝘆𝗯𝗿𝗶𝗱 𝗦𝗲𝗮𝗿𝗰𝗵 Vector similarity is great for "vibes," but for SQL, you need exact matches. Use Hybrid Search (Vector + Keyword) to ensure that when a user asks for "IDs," the retriever actually finds the "Employee IDs" column instead of record "id".
To view or add a comment, sign in
-
Getting an LLM to write SQL was the easy part. Getting it to know that "channel" has exactly four valid values in one specific column — that took longer than building the system. We had a real problem. Analytics team buried under repeat data requests. Business users waiting hours for answers they needed in minutes. Self-serve analytics kept coming up. So I experimented. Built a system where someone types a question in plain English and gets an answer from a data warehouse table. The architecture came together in weeks. LLM generates SQL. A validation layer checks every query against the real schema — wrong column, wrong syntax, wrong filter — and retries with corrective context. Semantic caching so the same question phrased differently doesn't cost another LLM call. Answer quality scoring that blocks vague responses before they reach anyone. The concepts exist. The tooling exists. If you know what to build, the building isn't the hard part. Then real questions showed up. The LLM didn't know our warehouse uses TOP, not LIMIT. Didn't know "channel" has exactly four valid values in one specific column. So I built 𝘁𝗿𝗮𝗶𝗻𝗶𝗻𝗴 𝗹𝗮𝘆𝗲𝗿𝘀. Golden queries for in-context learning. Business rules for column meanings. Negative patterns — explicit examples of what NOT to generate. SQL templates for complex joins and comparisons. All of that. And it works for simple to medium questions. Complex multi-dimensional queries still break. Forecasting isn't reliable yet. It's 𝗻𝗼𝘁 𝗹𝗶𝘃𝗲. The LLM can write SQL. It can't know your data. That gap isn't a model problem. It's a 𝘀𝗽𝗲𝗰𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 problem. And specification is the real work. What's been harder in your AI builds — the architecture or teaching the system your context? #GenAI #TextToSQL #EnterpriseAI #Analytics #LLM
To view or add a comment, sign in
-
-
AI helps you if you know what you need and how it should work. AI generates a mess if you have no idea what you're doing. Creating a Fabric pipeline with Copy data activity to copy data from an on-prem SQL database via a data gateway to the bronze schema in a new Fabric Lakehouse using Claude Opus 4.6: ➡️ Default generic agent, simple prompt, no manual steering during prompt execution Almost 2 hours of prompt execution with multiple trial-and-error iterations, 2 pipelines (with multiple Copy data activities inside), and 3 copy jobs created - the model was trying to deal with failing runs and unsupported data types. Failure to load columns with data types not supported in Lakehouse, failure to load a table that contains no data without mentioning the fact of the table's existence in the source in the log. ➡️ Custom agent carefully crafted during multiple iterations of a self-reflecting and self-improving agent with some manual steering during agent building, but no manual steering during prompt execution: 28 minutes total time of prompt execution (including 11 minutes of pipeline execution), all tables copied using one simple pipeline, unsupported data types converted to text, all Fabric artifacts have descriptions, documentation generated, the results are validated (number of tables/columns/rows in the Lakehouse vs the database), metadata columns added to all tables.
To view or add a comment, sign in
-
-
Your decisions rely on data. Better make sure the data doesn't fail you. Data-inspired decisions always sound like a great idea in talks and textbooks. However, in the real world, it is rarely that easy to turn data into good decisions reliably. Here is why: 🏭 Features drift. We see this quite often with sensor data in the lab or on the shop floor. A sensor corrodes over time or a valve gets clogged. A measurement today sometimes does not mean the same thing it meant yesterday. 🔀 Schemas evolve. This happens constantly when we scrape something from the web or use external APIs. The sources can change at any moment, so you better plan for it. If we want our AI/ML systems to deliver value over a longer period of time, we have to build them defensively. Expect errors in your data all the time. Surprisingly, just sticking to the basics brings us quite far in most cases: 🚨 Fail loud and early. If data is problematically wrong, we need to know immediately. 🛠️ Keep it simple. We don't need to be fancy about it. Basic sanity checks like "Are all expected fields present?" or "Are the values in the expected range?" catch way more problems than you might expect. 🐍 In the Python world, my tool of choice is Pydantic. When I started out with it, I thought to myself: Is it really necessary to write all these long boiler-plate BaseModels? Yes, it is. You write it once, and it saves you from a lot of pain down the road. The quest for good data is never over. But if the decisions your system is designed for are important enough, it is worthwhile to endure this constant struggle. We shouldn't make wrong strategic decisions just because Temperatur0 is suddenly renamed to temperature_start.
To view or add a comment, sign in
-
𝗗𝗮𝘆 𝟭𝟬 𝗼𝗳 𝟰𝟬: 𝗧𝗵𝗲 𝗦𝗽𝗲𝗲𝗱 𝗗𝗲𝗺𝗼𝗻 : 𝗩𝗲𝗰𝘁𝗼𝗿 𝗜𝗻𝗱𝗲𝘅𝗶𝗻𝗴 (𝗛𝗡𝗦𝗪 𝘃𝘀. 𝗜𝗩𝗙) ⚡ We have chunked the data and embedded it. Now, how do we search through 10 million rows in milliseconds? In my 5 years of engineering, I have learned that a database without an index is just a slow text file. But you cannot use a standard B-Tree for "similarity." You need 𝗔𝗽𝗽𝗿𝗼𝘅𝗶𝗺𝗮𝘁𝗲 𝗡𝗲𝗮𝗿𝗲𝘀𝘁 𝗡𝗲𝗶𝗴𝗵𝗯𝗼𝗿 (𝗔𝗡𝗡) 𝗮𝗹𝗴𝗼𝗿𝗶𝘁𝗵𝗺𝘀. 𝗧𝗵𝗲 𝗧𝘄𝗼 𝗛𝗲𝗮𝘃𝘆𝘄𝗲𝗶𝗴𝗵𝘁𝘀: 𝟭. 𝗛𝗡𝗦𝗪 (𝗛𝗶𝗲𝗿𝗮𝗿𝗰𝗵𝗶𝗰𝗮𝗹 𝗡𝗮𝘃𝗶𝗴𝗮𝗯𝗹𝗲 𝗦𝗺𝗮𝗹𝗹 𝗪𝗼𝗿𝗹𝗱) • 𝗧𝗵𝗲 𝗩𝗶𝗯𝗲: Think of a high-society party. You talk to a few "connected" people (top layer) who point you to the right "friend group" (bottom layer). • 𝗣𝗿𝗼𝘀: Lightning-fast queries and high accuracy. It’s the "Gold Standard" for production. • 𝗖𝗼𝗻𝘀: High memory usage (RAM hungry) and slow to build the initial index. 𝟮. 𝗜𝗩𝗙 (𝗜𝗻𝘃𝗲𝗿𝘁𝗲𝗱 𝗙𝗶𝗹𝗲 𝗜𝗻𝗱𝗲𝘅) • 𝗧𝗵𝗲 𝗩𝗶𝗯𝗲: Like a library organized into sections. You find the right "bucket" first, then search only inside that bucket. • 𝗣𝗿𝗼𝘀: Very memory efficient and faster to build than HNSW. Great for massive datasets that don't fit in RAM. • 𝗖𝗼𝗻𝘀: Slightly lower accuracy (you might miss the perfect match if it's sitting on the edge of another bucket). 𝗧𝗵𝗲 "𝗗𝗮𝘆 𝟭𝟬" 𝗛𝗮𝗰𝗸: If you are using 𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝘀 𝘄𝗶𝘁𝗵 𝗽𝗴𝘃𝗲𝗰𝘁𝗼𝗿, you have to choose between ivfflat and hnsw. • Use 𝗶𝘃𝗳𝗳𝗹𝗮𝘁 if you are short on memory and can afford a longer "training" phase. • Use 𝗵𝗻𝘀𝘄 if you need the absolute fastest search and have the RAM to spare. 𝗠𝘆 𝘁𝗮𝗸𝗲: • 𝗙𝗼𝗿 𝗙𝗿𝗲𝘀𝗵𝗲𝗿𝘀: Just remember that Index = Speed. Without it, your RAG app will lag as your data grows. • 𝗙𝗼𝗿 𝘁𝗵𝗲 𝗣𝗿𝗼𝘀: This is where 𝗣𝗿𝗼𝗱𝘂𝗰𝘁 𝗤𝘂𝗮𝗻𝘁𝗶𝘇𝗮𝘁𝗶𝗼𝗻 (𝗣𝗤) comes in ,compressing your vectors so they take up 90% less space. It is a trade-off between "Storage Cost" and "Answer Precision." 𝗔𝗿𝗲 𝘆𝗼𝘂 𝗯𝘂𝗶𝗹𝗱𝗶𝗻𝗴 𝗮 "𝗕𝗿𝘂𝘁𝗲 𝗙𝗼𝗿𝗰𝗲" 𝘀𝗲𝗮𝗿𝗰𝗵, 𝗼𝗿 𝗮𝗿𝗲 𝘆𝗼𝘂 𝗿𝗲𝗮𝗱𝘆 𝘁𝗼 𝗶𝗻𝗱𝗲𝘅 𝗹𝗶𝗸𝗲 𝗮 𝗽𝗿𝗼? See you tomorrow for 𝗗𝗮𝘆 𝟭𝟭, where we’ll talk about 𝗠𝗲𝘁𝗮𝗱𝗮𝘁𝗮 𝗙𝗶𝗹𝘁𝗲𝗿𝗶𝗻𝗴, the "WHERE clause" of the AI world. #GenAI #40DaysOfAI #SoftwareEngineering #FullStack #VectorDatabase #HNSW #Postgres #SystemDesign #BuildInPublic
To view or add a comment, sign in
-
-
The Art of Designing Queries When working with SQL, we’re often told: “Keep everything at the database level.” And most of the time, that’s great advice. But in practice, performance engineering is rarely that simple. Sometimes the best solution involves: - Well-designed indexes - Materialized views for heavy aggregations - Subqueries or query refactoring - In-memory computation for constant or frequently reused values - Caching to avoid repeated expensive operations Each option comes with its own trade-offs — latency, memory usage, freshness of data, and complexity. The real skill isn’t just writing queries. It’s analyzing the workload, understanding the data access patterns, and choosing the right strategy. 💡 Tip: When dealing with complex queries, experiment with different approaches and analyze execution plans from your ai agent. Sometimes a small structural change can lead to massive performance gains. #Database #SQL #SystemDesign #DataEngineering #PerformanceEngineering
To view or add a comment, sign in
-
Vectorless RAG is quietly changing how we build retrieval systems. And most engineers haven't noticed yet. Here's what's happening We've been told for 3 years that RAG = embeddings + vector database. Chunk your docs. Embed everything. Store in Pinecone / Weaviate / Qdrant. Do similarity search at query time. It works. But it comes with baggage: Embedding drift across model versions Chunk size tuning that never feels right Semantic search that misses exact keyword matches Infrastructure cost of maintaining a vector store Re-indexing nightmares when your embedding model changes Vectorless RAG skips all of that. Instead of converting text into dense vectors, it uses approaches like: BM25/TF-IDF scoring (yes, the "old" stuff still hits) Knowledge graphs that preserve entity relationships SQL-based retrieval where structured data already lives LLM-native retrieval - feeding docs directly into large context windows ColBERT-style late interaction without traditional vector indexes When does vectorless make sense? Your data is already structured (tables, APIs, databases) You need exact match + keyword precision over fuzzy similarity You're working with smaller document sets that fit in context You want to skip the embedding pipeline entirely Your retrieval needs change faster than you can re-index When do you still want vectors? Massive unstructured corpora Semantic similarity is the core requirement You need multilingual or cross-modal retrieval Scale demands approximate nearest neighbor search
To view or add a comment, sign in
-
-
AI tools are excellent at generating SQL. You can ask for: • joins across multiple tables • filtering and aggregation • pagination queries • reporting queries And the result usually works immediately. But database performance problems rarely start with the query. They start with the schema design. Early-stage products often design tables only around features: Add a column when a feature needs it. Add another table when new data appears. It works for a while. But as data grows, poorly structured schemas lead to: • complex joins everywhere • slow analytics queries • duplicated data across tables • difficult migrations Production systems treat schema design as long-term architecture. That means thinking early about: • normalization vs practical denormalization • indexing strategy • query patterns you expect at scale • how data will evolve over time AI can generate SQL in seconds. But scalable systems are built by engineers who realize that good queries come from good schema design. #Databases #SystemDesign #BackendEngineering #ScalableSystems #AIAgents #SoftwareEngineering
To view or add a comment, sign in
-
We are now operating in an AI-driven landscape where raw activity data is no longer sufficient. Logging events is easy. Extracting meaning is hard. Machine learning systems don’t need more noise—they need: structured signals, verified outcomes, aggregated performance, and deterministic logic. In other words, they need preprocessed intelligence. SQL LRS is designed to deliver exactly that. https://lnkd.in/eD8JKESX
To view or add a comment, sign in
Hydrolix Inc.•44K followers
1moClaude skills are changing how we combine data, LLM reasoning, and domain knowledge to deliver apps.