RSSAmplifier

Blog

All things

dzlab.github.ioRSS feed ↗102 posts

Latest posts

AI Code Review: Context, Retrieval, and Specialized Review Agents

AI coding assistants make it easy to generate more code than a team can carefully review by hand. That changes the bottleneck. The hard question is no longer only “can we write the code?”, but also “can we review it with enough context to catch missed requirements, security gaps, and codebase-specific pattern violations?” AI Review In this article, we will build an agentic AI Review system that…

Google Cloud Professional Cloud Architect Certification Preparation Guide

The Google Cloud Professional Cloud Architect exam is less about remembering every product feature and more about making sound architecture decisions under constraints. Most questions describe a business goal, an existing technical environment, a migration pressure, a security requirement, or an operational problem. The right answer is usually the one that satisfies those constraints with the…

Building with Spec Kit

Spec-driven development is a methodology that emphasizes on defining a detailed specification for an application or feature before writing any code. This approach involves providing a Large Language Model (LLM) with a comprehensive set of instructions, constraints, and goals. Then, the LLM uses this “spec” to generate the application code, ensuring the final product aligns with the initial vision.…

How to Write a Design Document That Works

A design document is a technical report that outlines the implementation strategy for a system, detailing it within the context of its trade-offs and constraints. The primary goal is to convince the reader—and, most importantly, yourself—that the proposed design is the optimal solution given the circumstances. The act of writing forces a level of rigor that transforms vague intuitions into a…

PostgreSQL performance tuning with MCP and Claude

Is your web application grinding to a halt? Users complaining about slow page loads? Before you throw more hardware at the problem or implement complex caching layers, you should first try to reveal exactly what’s slowing down your PostgreSQL database. Meet pg-extras-mcp – a diagnostic tool inspired by ruby-pg-extras , it exposes a set of well known troubleshooting SQL queries as a collection of…

Reverse Engineering Zed's AI Coding Assistant with mitmproxy

The allure of AI coding assistants like Zed is undeniable. They promise streamlined workflows and enhanced productivity, but their inner workings often remain shrouded in mystery. This article details how to reverse engineer Zed using mitmproxy , providing insights into its System prompt, prompting strategies and API interactions with Large Language Model (LLM) providers. Motivation Before…

Advanced Retrieval Techniques to Supercharge Your RAG

Retrieval Augmented Generation (RAG) has become a cornerstone for building powerful AI applications that can leverage vast amounts of information. At its heart, RAG relies on vector databases as a knowledge source, storing information as embeddings (i.e. numerical vectors) that represent the semantic meaning of text, images, or other data types in a high-dimensional space. These embeddings are…

Integrating Elasticsearch with AI agents through Model Context Protocol

Large Language Models (LLMs) are getting better every day at understanding all sorts of data, but they still suffer from knowledge cut-off when dealing with data that were not part of their pre-training. By integrating LLMs with external systems and knowledge bases, LLMs could achieve their true potential as they allow users to query and analyze complex data with natural conversations. Model…

An In-Depth Look at Claude's System Prompt

We recently got a glimpse into the System Prompt of Claude, the AI assistant developed by Anthropic, after it was leaked to the public on GitHub . This System Prompt, a kind of an operational playbook, provides a fascinating look at the intricate instructions that governs Claude’s behavior, from how it communicates and engage in a conversation, to the way it handles problem solving tasks. The rest…

Pinterest's Wide Column Database in Python with RocksDB

In a recent article on Pinterest Engineering Blog , they desribed in details how they implemented in C++ a RocksDB-based distributed wide column database called Rockstorewidecolumn . While their system tackles petabytes and millions of requests per second with a distributed architecture, the core concepts of mapping a wide column data model onto a key-value store like RocksDB are fascinating. This…

Building an Elasticsearch-based webapp with an AI Coding Partner

Tools available to Software developers are constantly evolving and changing how applications are developed. AI coding assistants rapidly become an indispensable tool for developping. In fact, the introduction of AI assistants created a new discipline widely known these days as “vibe coding”. It’s a dynamic, collaborative session where a developer and an AI assistant collaborate to build an…

Building data pipelines with Vector by Datadog

Vector is an open-source log aggregator developed by Datadog. Vector is a lightweight, exceptionally fast, and memory efficiency alternative to Logstash . Vector makes it easy to build observability pipelines by seamlessly capturing logs from many sources, applying transformations, and routing to one of the many predefined sinks. In this article, we will explore how to leverage Vector to collect…

Ingesting Stocks historical data into Elasticsearch

For those seeking to gain a deeper understanding of market trends, economic fluctuations, and consumer behavior, historical stock data is a treasure trove of insights waiting to be unearthed. In this blog post, we’ll explore how to ingest historical stock data into Elasticsearch. From data preparation to indexing, we’ll delve into the steps required to harness the power of historical data and…

AI agent from scratch with Gemini

LLMs like Google Gemini takes input for a single query and returns an output (e.g. text, image or audio), it cannot do more than a single task at a time. On the other hand, an Agent run iteratively with some goals / tasks defined. An agent uses complex workflows; it continusouly talks to the LLM without a human interaction until it reaches its goal. With the introduction of Function Calling ,…

Building a SQL processor with Apache Calcite

In a previous article , we saw how to create an Adapter for Apache Calcite and then how to run SQL queries against random data source. In this article we will see in step by step how to use Apache Cacite to implement a SQL processor to parse an input query, validate it and then execute it. As an example query we will use the following simple JOIN query between two tables customer and orders .…

SQL anything with Apache Calcite

Apache Calcite is a data management framework that provides many of the components that a typical database like Postgres would have. Mainly, Apache Calcite provides SQL parsing and validation, as well as query optimiser but does not provide implementation for data storage or data processing. It also supports custom functionalities such as new SQL syntax, functions, or storage plugins via a…

Streaming Data changes from Postgres to Elasticsearch

Postgres logical replication enables the streaming of the changes in the write-ahead log (WAL). This functionality uses Logical Decoding to transform the write-ahead log (WAL) into a format that can be consumed by external applications. This is further extended via a collection of plugins : pgoutput: a built-in plugin that comes with PostgreSQL 10 and later versions. It generates a binary format…

From Postgres to Elasticsearch through Debezium

In a previous article , we saw how to set up a CDC pipeline to capture Data changes from Postgres and stream them to Kafka using Debezium. In this article, we will stream the data changes from Postgres into ElasticSearch using Debezium, Kafka. Toplogy The below diagram highlights the different components of our cluster: Postgres - a Relational Database for storing the data and representing the…

From Postgres to Kafka through Debezium

Change Data Capture (CDC) allows changes propagation from a Data Source to downstream sinks. In particular, CDC is to capture row-level changes resulting from INSERT, UPDATE and DELETE operations in the upstream Relational Databses (e.g. Postgres) and propage these changes to analytical warehouse or Data Lakes. By leveraging Write-Ahead Log (WAL) , CDC does not modify the source database and as a…

ELK on Kubernetes with Helm Charts

This post explains how to setup an ELK (Elasticsearch, Logstash, and Kibana) stack on Kubernetes using Helm Charts. We will first, setup Kubernetes cluster on Google Cloud using GKE, then install on it all the components of ELK using Helm Charts. Setup Setting up a k8s cluster on Google Cloud is fairly easy, we just need to follow the official documentation . First, let’s set some global…

Setting Up Elastic-based logging stack with Docker Compose

Having a local setup of your Elasticsearch-based logging stack helps a lot with prototyping dashboards and experimenting with logging format or index patterns, etc. This post explains how to setup locally an ELK stack to capture logs from a service running locally with Docker Compose. First, lets define the different components of the stack: A Elasticsearch container that exposes port 9200 A…

LittleTable A Time-Series Database Built for Scale

Time-series data is everywhere in modern systems—from network monitoring and IoT sensors to application metrics and financial data. But storing and querying massive amounts of time-series data efficiently presents unique challenges. How do you handle hundreds of thousands of writes per second while maintaining fast query performance? How do you store terabytes of historical data without breaking…

ML Pipelines on GCP with Vertex AI

Vertex AI Pipelines are a platform for building and running machine learning workflows on Google Cloud Platform. They allow the orchestration of machine learning tasks using pre-built or custom components, and leverage the serverless and scalable infrastructure of Vertex AI. Vertex AI Pipelines is based on the open source Kubeflow Pipelines, but they the two have some differences in terms of…

Extracting structured data from unstructured text with PaLM

In this article, we’ll go over one of the main use cases that LLMs like PaLM are used for, which is extracting specific entities from unstructured text. These entities are represented by a structured description of multiple pieces of information, and the LLM to look over the text and extract a list of these elements at once. For instance, we might ask the LLM to look over an article and extract a…

Scalable RAG applications on GCP with Serverless architecture - Part 2

In a previous article , we built a serverless data pipeline to make an entire dataset searchable using simple English. In this second part, we will build a query anwering pipeline as represented by the Steps 7 to 10 in the diagram above. We will leverage pgvector Cosine search operator to filter documents from our dataset and Vertex AI with LangChain to generate a final answer based on the…

Scalable RAG applications on GCP with Serverless architecture - Part 1

Retrieval-Augmented Generation (RAG) is an AI framework that enhances the quality of Large Language Model (LLM)-generated responses by supplementing the LLM’s internal representation of information with external sources of knowledge. This gives us control over the data used by the LLM when it formulates a response. With RAG, we can constrain the external information accessible to the LLM to…

RESTful web services in Scala 3 using ZIO

In ZIO, an HTTP service is defined by extending the zio.http.Http trait: trait Http [ -R , +E , -A , +B ] extends ( A => ZIO [ R , Option [ E ] , B ]) A Http[R, E, A, B] is a function that takes an A and returns a ZIO[R, Option[E], B] . More specifically, it: Uses the R from the environment Will fail with E if there is an error Accepts an A and returns B In the rest of this article, we will see…

Generating Synthetic Data for NLP tasks in Java with llm4j and PaLM

Creating datasets for training Natural Language Processing (NLP) models is a complex and resource-intensive task. This is because the quality and diversification of the data have direct impact on the performance of the model. It gets even harder when bigger models as they will require a large amount of data for training. One way to effectively manage the data collection at scale is to create a…

Building an Article Recommender App in Java with llm4j, PaLM and Elasticsearch

In this tutorial we will see how to build a News Article Recommender app that uses PaLM (a powerful LLM from Google) for calculating text embeddings and Elasticsearch to compare between articles and find similar ones based on their embeddings. Such application is particularly useful to keep users of a newspaper (or any content platform) engaged as it recommends articles related to their reading…

Run LLMs from Hugging Face on GCP with Cloud Run and Cloud Storage

This article demonstrates how to run a custom Large Language Model on GCP with Cloud Run and use Cloud Storage as a network file system to host the weights downloaded from a model hub. By leaveraging Cloud Storage, the weights will be downloaded once so we can scale the number of Cloud Run containers up or down faster as new instances will not have to pay extra time for downloading model weights…

Serverless Meeting minutes generator on GCP with Vertex AI and Cloud Functions

GCP is a powerful platform for building all sort of applications. It hosts a variety of services which are scalable, reliable, cost-effective, easy to use, and can be easily integrated together. In a previous article, we saw how to leverage GCP’s Vertex AI to develop an automated meeting minutes generator . In this article, we will re-architecture that application to make it more scalable and…

Meeting minutes generator on GCP with Vertex AI and Cloud Run

Vertex AI is a managed machine learning platform within Google Cloud Platform that helps building, deploying, and scaling machine learning models. It offers a Model Garden which is a collection of ready to use foundation ML models that can be used for different tasks. Examples of such models are Chirp which can be used for speech-related task, and PaLM which is a large language model that can be…

Generative AI project lifecycle

Generative AI is a powerful technology that has the potential to revolutionize many industries. However, generative AI projects are complex, time-consuming and involves many phases. We can increase the chances of success for such projects by following a well defined framework that maps out the tasks required to take a project from conception to launch. In this article, we will describe a…

Deploy Generative applications on GCP with Cloud Run

Vertex AI in Google Cloud Platform provides a comprehensive set of tools and services that make it easy to build and deploy generative AI applications. For developpement and testing, Vertex AI provides: Model Garden : Access to foundation models which are pre-trained generative AI models to prototype and test generative AI applications without the need to train your own models. Those models cover…

Scale LLM-based applications to millions with LangChain and GPTCache

Overview In Software Engineering, whenever there is high cost for producing a result for a given query, a cache is used to avoid wasting resources again and again on calcuting the same result. Usually, the way a cache is a key-value data structure used as follows: For a first time seen query, the results are stored temporarily in high-speed storage layers (e.g. RAM or SSDs), When a new query…

Elasticsearch Use Cases in Cybersecurity: A Technical Deep Dive

Introduction In today’s rapidly evolving threat landscape, security teams face an overwhelming volume of data from diverse sources. Logs, alerts, vulnerability reports, and threat intelligence feeds generate terabytes of information that need to be collected, processed, and analyzed effectively. Elasticsearch has emerged as a powerful tool in the cybersecurity arsenal, enabling teams to harness…

Deploy Elasticsearch on GCP using Terraform

Elasticsearch is available in GCP marketplace as a fully managed service that makes it easy to deploy, operate, and scale Elasticsearch clusters within Google Cloud platform. With GCP Elasticsearch service, we can create GCP Elasticsearch architecture that suits our application needs at the click of a button. Furthermore, it does provide seamless way for data ingestion; time is saved for…

Elasticsearch use cases in cybersecurity

Elastic Stack at its core relies on Elasticsearch, Kibana and a variety of data ingestion tools. Elasticsearch with its capabilities for indexing and retrieving of textual data, and Kibana for analytics and visualization of data stored in Elasticsearch indices. Furthermore, Kibana is very intuitive, making it very easy to perform advanced data analysis and visualize of data in a variety of charts,…

Network observability with Elasticsearch on GCP

On a previous Article , we discussed the need for setting up a centeralized log management platform to debug network issues. In the remaining of this article, we will briefly describe the architecture and then deep dive into deploying it on GCP using Cloud Deployment Manager. Overview of the architecture The above diagram illustrates a high level solution on how to build a network observability…

Get started with Packetbeat for network monitoring

Packetbeat is a real-time network packet sniffer/analyzer which can be combined with Elasticsearch and Kibana to provide a powerfull network monitoring solution. Packetbeat captures network traffic from local devices and decodes a varity of application layer protocols (e.g. HTTP, MySQL, Redis). It is also capable of correlating the requests with their responses. Technically, it is based on the…

Network observability with Elasticsearch on AWS - Part II

In Part I, we discussed the need for setting up a centeralized log management platform to debug network issues. In this second part, we will deep dive into deploying this platform on AWS using Terraform. Deploying with Terraform Elasticsearch cluster can be deployed from AWS Marketplace while other AWS resources like the VPC Flow Logs, the S3 buckets, the Lambda function, and the SQS queues can be…

Network observability with Elasticsearch on AWS - Part I

Network issues are very common source of trouble for micro-services but still are not easy to troubleshoot, especially in a cloud environment. For instance, you may have seen puzzling cases where a lot of log entries in one service contain connection timeout errors yet no indication of issues can be found in the logs of the remove service. Cloud providers usually provide tools to help pinpoint the…

Prompt engineering for question answering with LangChain

Large language models (LLMs) like GPT-3 can produce human-like text given an initial text as prompt. They can also be customised to perform a wide variety of natural language tasks such as: translation, summarization, question-answering, etc. This customization steps requires tweaking the prompts given to the language model to maximize its effectiveness. This tweaking process requires many…

Kibana startup fails with re2.node not valid for use in process library load disallowed by system policy

I was trying to setup Kibana locally on macOS Monterey version 12.5.1 (21G83), so I downloaded Kibana and installed it like this: $ tar xzf kibana-8.5.3-darwin-aarch64.tar.gz $ cd cd kibana-8.5.3 But when I tried to start Kibana, I encountered the following error: $ bin/kibana [ 2022-12-21T11:54:31.067+01:00][INFO ][ node] Kibana process configured with roles: [ background_tasks, ui] […

Stackable Trait in Scala

I come across some old scala code that uses what turns out to be a very rare pattern in Scala called Stackable Trait. The only reference to this pattern I could find on the Internet was this old article . In this article, we will explore how it can be used with a toy example. Pattern From a high level, this pattern aims to reduce the boilerplate code needed to combine multiple implmentations but:…

GCP DevOps Certification Preparation Guide

I recently passed Google Professional DevOps Engineer Certification and, while preparing for it, I went through a lot of resources. I had to review the documentation of many Google Cloud products, and at no point did I feel that one source covered everything I needed. This article summarizes the resources I found helpful for passing the exam, plus the topics I wish I had spent more time reading…

A tour of ZIO

There are lot of libraries that makes it easy to develop concurrent applications on the JVM, most notably Akka that uses the Actor model. In fact, Akka actors can be used to solve a lot of challenges, but they also have high implications: Requires modeling the application in terms of actors and their interactions in terms of message passing Leads to complex code as everything in the application is…

Exploring car diagnostic data with Elasticsearch and Kibana

In this article we will collect car diagnostic data using python and ELM327 WIFI OBD2 Scanner, once data is collected we will import it into Elasticsearch for analysis. Collecting data with an OBD2 Scanner To be able to collect the data you may need to get a Professional ELM327 WIFI OBD2 Scanner Code Reader/Erases Auto Diagnostic Tool like the one depicted in the following picture. Once the…

GCP Developer Certification Preparation Guide

I recently passed Google Professional Developer Certification, during the preparation I went throught lot resources about the exam. I also used this book which is a good read and covers most of the exam topics. It is very good starting point for the preparation if you have little knowledge on Google Cloud services. Keep in mind that Google update its services very often, thus any source of…

Access Google Storage as an S3 endpoint

Google Storage provide access thorugh different ways, one of the interesting access patterns is to considered as an S3 endpoint and access it through one of the S3 SDKs (See interoperability documentation - link ). This is very convinient in case you have an application that currently runs against AWS S3 and you are in the process to migrate it to GS. In this, article we will see how to access…