Latest Updates

Documenting code, one commit at a time.

Content Negotiation for AI Agents: Serving Markdown

Our application now supports content negotiation to better serve AI agents and LLMs. We've added the ability to return Markdown instead of HTML when requests include the Accept: text/markdown header.

This enhancement allows AI agents to directly consume the raw Markdown content of our posts, simplifying parsing and improving efficiency.

The Problem

Previously, our application served HTML

Read more
PHP Java MySQL

Tenant-Centric Quota Management with Manual Overrides

Managing resource quotas across multiple tenants can be challenging, especially when the need for manual overrides arises. This post explores how we refactored our token usage service to implement a tenant-centric quota system with support for manual adjustments.

The Challenge

Previously, our token quota management was user-based. This created inefficiencies when the context already provided

Read more

Enhancing Application Stability with Strategic Cache Invalidation

Introduction

Maintaining data consistency across distributed systems and applications often requires careful management of caches. Stale data in caches can lead to unexpected behavior and inconsistencies. We recently implemented several enhancements to our application's caching strategy, focusing on proactive invalidation to ensure data accuracy and prevent outdated information from impacting

Read more

Improving AI Usage Tracking with Refactored Queries

Optimizing AI Token Usage Queries

We've recently refactored and optimized our AI token usage tracking to improve performance and maintainability. This involved extracting duplicated queries and enhancing user filtering.

The Changes

The primary focus was on improving the efficiency of retrieving daily and monthly tenant AI usage data. This was achieved through two key changes:

Read more

Implementing Payment Provider Abstraction with Feature Flags

When integrating multiple payment providers into an application, managing the transition and allowing for flexibility becomes crucial. This post explores how to introduce an abstraction layer combined with feature flags to handle different payment providers, such as Stripe and Paddle.

The Challenge

Directly integrating a payment gateway like Stripe can tightly couple the payment logic within

Read more

Enhancing the Quoting Module with New Features

Overview

Recent development efforts have focused on enriching the quoting module within our application. These enhancements streamline the user experience and improve overall functionality by introducing autocomplete capabilities, refined matching algorithms, and integrated conversation features.

Key Enhancements

Autocomplete Functionality

The addition of autocomplete significantly

Read more

Enhancing Application Logging with Tenant Context

Introduction

Effective logging is crucial for monitoring and debugging applications, especially in multi-tenant environments. This post explores how to enhance application logging by incorporating tenant-specific context, enabling better isolation and analysis of log data.

The Importance of Tenant-Aware Logging

In a multi-tenant system, logs from different tenants are often interleaved,

Read more