AI 资讯
Agent Accounts Quickstart in Python
A connected Gmail grant starts with an OAuth consent screen and ends with a refresh token you have to babysit; a Nylas Agent Account starts and ends with one POST request. Same API surface afterward — same messages endpoints, same webhooks, same calendar — but the provisioning story couldn't be more different, and that difference is what makes these hosted mailboxes such a natural fit for Python automation, agents, and test harnesses. Agent Accounts are in beta, and the official quickstart gets you from nothing to a sending-and-receiving mailbox in under 5 minutes using curl. Here's the whole flow as a Python script. Step 0: prerequisites You need an API key (run nylas init with the CLI, or use the Dashboard) and a domain. The fast path for testing: register a *.nylas.email trial subdomain from the Dashboard — no DNS records, instantly usable. Custom domains need MX and TXT records published at your DNS provider, with automatic verification once they propagate; save that for production. import os import requests BASE = " https://api.us.nylas.com " HEADERS = { " Authorization " : f " Bearer { os . environ [ ' NYLAS_API_KEY ' ] } " , " Content-Type " : " application/json " , } Step 1: provision the account POST /v3/connect/custom with "provider": "nylas" . No refresh token — just an email address on a registered domain: resp = requests . post ( f " { BASE } /v3/connect/custom " , headers = HEADERS , json = { " provider " : " nylas " , " settings " : { " email " : " test@your-application.nylas.email " }, }, ) resp . raise_for_status () grant_id = resp . json ()[ " data " ][ " id " ] print ( f " Agent Account live: { grant_id } " ) Save that grant_id — per the docs, you'll use it in every subsequent call. The mailbox works with every existing endpoint from this moment on. If you want policies or mail rules applied, add a top-level workspace_id to the same request body; the account inherits the workspace's limits, spam settings, and rules. Omit it and the account lands i
AI 资讯
Your AI agent doesn't have a memory. It has a transcript.
Notes from building a memory layer that forgets on purpose. Most "memory-enabled" agents don't remember anything. They re-read. Every turn, the whole conversation gets pasted back into the prompt, and we call that memory because the model can answer questions about earlier turns. It's a good trick. I used it for months. It also falls apart the moment real people start using the thing, and it falls apart in three separate ways. The first is the one everyone notices: it's expensive and noisy. You re-send every prior turn on every request. The single line you actually care about - "I'm allergic to peanuts" - is buried under a thousand lines of small talk, and you pay for all of it, every time. The second is quieter and worse. Transcript-stuffing has no idea what stale means. If someone told your agent "I'm vegetarian" in March and "I eat fish now" in May, you've just handed the model both facts with equal weight. Now it has to guess which one is current. Sometimes it guesses wrong, and there's nothing in the system that even thinks that's a problem. The third one is the reason I stopped treating this as a side quest. When you finally add summarization to control the cost from problem one, the summarizer is free to drop whatever it wants to save tokens. Including the allergy. I spent years around fintech, where the wrong record surviving (or the right one quietly vanishing) is how people get hurt, so this landed hard: forgetting an allergy to save 40 tokens isn't a cost bug. It's a safety bug wearing a cost bug's clothes. So the question I actually wanted to answer wasn't "how do I make my agent remember more." It was: how do I build something where acting on a fact the user already retracted and silently dropping a fact that must survive are impossible by construction, not just unlikely if the prompt is good that day. Everyone has already solved one third of this The encouraging part is that you don't have to invent much. The discouraging part is that every existing sy
AI 资讯
A load balancer inspired by how Emperor Penguins survive Antarctic winters
Why I modeled a load balancer after Emperor Penguin huddles A few months ago I was reading about how emperor penguins survive Antarctic winters. Temperature drops to -40°C, wind hits 120km/h, and somehow these birds make it through. Not because they're individually tough. Because they rotate. Cold penguins on the outside push inward. Warm ones from the center move out to rest. Nobody coordinates this. No penguin is in charge. It emerges from one simple rule: if you're cold, push in. If you're warm, you'll get pushed out eventually. I couldn't stop thinking about this. I was working on a service mesh at the time and dealing with the usual problem — one slow server quietly dragging down the whole cluster. Round robin doesn't care. Least connections helps but not always. Weighted approaches need manual tuning that goes stale immediately. The penguin thing kept nagging at me. What if servers had a "temperature"? What if hot servers rotated out to rest? That's HuddleCluster. The basic structure Two rings: Inner ring (deque): Active servers. Requests go to them round-robin. Simple, fair, zero overhead for normal traffic. Outer ring (min-heap): Resting servers. Keyed by temperature — coolest server sits at the top, ready to rotate back in first. When a server in the inner ring runs hot past a threshold, it moves out. When an outer ring server cools down, it comes back in. That's the entire rotation logic. About 50 lines of Python. What is "temperature"? This took me a while to get right. My first attempt was just raw latency. That was bad. A server handling one slow database query looks terrible even when it's completely healthy. I needed something more composed. Current formula: pythontemperature = EMA( 0.7 * relative_latency_anomaly + 0.1 * cpu_score + 0.1 * memory_score + 0.1 * (error_rate + connection_score) ) Three decisions here worth explaining. EMA over simple moving average EMA weights recent measurements more heavily. If a server just had a bad spike but recovere
开源项目
🔥 ArchipelagoMW / Archipelago - Archipelago Multi-Game Randomizer and Server
GitHub热门项目 | Archipelago Multi-Game Randomizer and Server | Stars: 1,460 | 3 stars today | 语言: Python
开源项目
🔥 Flowseal / tg-ws-proxy - Local MTProto proxy server for partial bypassing of Telegram
GitHub热门项目 | Local MTProto proxy server for partial bypassing of Telegram loading | Stars: 7,484 | 102 stars today | 语言: Python
AI 资讯
Build a RAG Pipeline for Internal Runbooks with FastAPI and Chroma
Pipeline & Prompts | Byte size guides on DevOps, Cloud and AI AI in the Stack #2 ⚡ Byte Size Summary RAG inserts a retrieval layer between your existing runbooks and an LLM — answers come from your documentation, not generic training data, with source citations included. This article builds a complete FastAPI service with /ingest , /query , and /health endpoints, using OpenAI embeddings and Chroma as the vector store. Everything is cloneable from GitHub. The goal is not to replace your runbooks. It is to make them queryable at the moment an incident is happening. I have never met a platform team with bad runbooks. I have met plenty of platform teams where the runbooks exist, are reasonably well written, are stored somewhere sensible — and are still completely useless at 2am when something is on fire. Not because the content is wrong. Because nobody can find the right one fast enough. The search in Confluence returns fourteen results and none of them are titled the way the engineer is thinking about the problem. The person on call is junior and doesn't know the runbook exists. The runbook was written for a slightly different version of the service and nobody updated it. The runbook problem is not a writing problem. It is a retrieval problem. That is exactly the problem RAG was built to solve — and it is one of the highest-ROI first applications of AI in a platform engineering context. Not because it is technically impressive. Because it closes a gap that costs your team hours every month. This article builds a working pipeline. By the end you will have a FastAPI service that takes a natural language question — "why is my pod stuck in CrashLoopBackOff after a config change?" — and returns an answer grounded in your actual runbooks, with the source document cited. Everything is in the GitHub repo agentic-devops What RAG Is — Without the Hype RAG stands for Retrieval-Augmented Generation. Instead of asking an LLM a question and hoping its training data contains the answ
AI 资讯
I Spent Two Weeks Pitting Qwen 3 Max Against DeepSeek V4
I Spent Two Weeks Pitting Qwen 3 Max Against DeepSeek V4 I want to tell you about a rabbit hole I fell into recently. It started the way most of my projects do — someone on a Discord server I frequent asked a simple question: "Should I use Qwen 3 Max or DeepSeek V4 for my internal_compare workflow?" I had opinions, sure, but I wanted real numbers. So I cleared my calendar, fired up a couple of GPU instances, and started benchmarking. What I found surprised me, and it also reinforced something I've been saying for years: the open source ecosystem is winning, and the walled gardens of the proprietary AI world are starting to look pretty silly. Let me walk you through what I learned, the actual numbers I got, and why I keep coming back to open weight models with permissive licenses (looking at you, Apache 2.0 and MIT). Why I Care About This in the First Place I've been burned too many times by closed source vendors changing their pricing overnight, deprecating models without warning, or locking features behind enterprise tiers. You know the drill. The moment your application depends on a proprietary API, you're renting infrastructure you can't inspect, can't fork, and can't run on your own hardware. That's not a partnership — that's a leash. When a model ships under Apache or MIT, I can download the weights, audit the architecture, fine-tune it on my own data, and deploy it wherever I want. Nobody can rug-pull me. Nobody can raise prices because some quarterly earnings call didn't go their way. That's freedom, and freedom matters more than people think when you're building anything serious. So when I started this comparison, I was already rooting for the open weight contenders. But I wanted to be honest about the results, even if they complicated my bias. The Lineup I Tested Global API currently exposes 184 models through a single unified endpoint, which is honestly wild. I picked five that I thought represented the interesting tradeoffs between cost, capability, and o
开发者
Pooling contra una t3.micro, el día que se reventó...RDS Proxy es la salida?
Cómo un backend de FastAPI + asyncpg comparte un solo Postgres chiquito con sus propios trabajadores en segundo plano y un segundo servicio, por qué el techo de conexiones, no el CPU, es lo que de verdad le pone tope a nuestro autoescalado, la caída en el cambio de hora que nos enseñó la cuenta, y una mirada honesta a RDS Proxy como la válvula de escape (incluyendo la trampa de asyncpg que lo puede dejar sin hacer nada). TL;DR Ajuste Valor Por qué Driver postgresql+asyncpg asíncrono hasta el fondo pool_size / max_overflow 8 / 12 (20 por proceso) subido desde 3/5 después de una caída pool_pre_ping True mata los sockets muertos tras un reinicio de RDS / inactividad pool_recycle 1800 s techo duro que el pre-ping no puede cubrir Tope de conexiones de RDS ~87 (t3.micro, menos las reservadas) la verdadera restricción de todo Pruebas NullPool sin pooling entre event loops en pytest La lección que replanteó todo el problema: en un RDS chico, tu cuenta máxima de tareas la fija max_connections , no el CPU ni la memoria. Un autoescalado que ignora el presupuesto de conexiones va a escalar directito hacia QueuePool limit reached , o peor, FATAL: too many connections del mismo Postgres. El pool, y la cuenta escondida adentro de él engine = create_async_engine ( settings . DATABASE_URL , connect_args = { " ssl " : " prefer " }, # negocia TLS en RDS, texto plano en local pool_pre_ping = True , pool_size = 8 , max_overflow = 12 , # 8 + 12 = 20 conexiones por proceso pool_recycle = 1800 , ) Veinte conexiones por proceso se ven modestas hasta que las multiplicas por cada capa entre ellas y la base de datos: pool_size + max_overflow = 20 por proceso de Python × 2 trabajadores de uvicorn = 40 por tarea de Fargate × 2 durante un despliegue rolling = 80 (tarea vieja drenando + tarea nueva arrancando) + servicio de inteligencia (3 + 7) = 10 sobre la misma base de datos + alembic / ad-hoc / psql ≈ unas pocas ---------------------------------------- ≈ 87 ← el techo de la t3.micro, con ~0 de
开源项目
🔥 safishamsi / graphify - AI coding assistant skill (Claude Code, Codex, OpenCode, Cur
GitHub热门项目 | AI coding assistant skill (Claude Code, Codex, OpenCode, Cursor, Gemini CLI, and more). Turn any folder of code, SQL schemas, R scripts, shell scripts, docs, papers, images, or videos into a queryable knowledge graph. App code + database schema + infrastructure in one graph. | Stars: 67,157 | 5,478 stars this week | 语言: Python
AI 资讯
Automate Your Healthcare: Building an AI Agent to Book Doctor Appointments and Archive Lab Reports
We've all been there: staring at a clunky, 10-year-old hospital web portal, clicking through endless nested menus just to book a simple check-up or download a PDF lab result. It's tedious, error-prone, and frankly, a waste of human potential. But what if you could just tell an AI, "Book me a dermatologist for next Tuesday and save my blood test results to my health folder," and it just... did it? In this tutorial, we are diving deep into the world of autonomous agents , GPT-4o , and LLM-driven web navigation . By leveraging the revolutionary Browser-use library and Playwright , we’ll build a vision-capable agent that can navigate complex UIs, handle logins, and automate the most frustrating parts of healthcare administration. 🚀 Why Traditional Scraping Fails (and Why Agents Win) Traditional automation tools like Selenium or Puppeteer rely on brittle DOM selectors ( #button-id-342 ). When a hospital updates its website, your script breaks. Using Browser-use with GPT-4o changes the game. Instead of looking for code, the agent sees the page like a human, understanding that a magnifying glass icon means "Search" regardless of the underlying HTML. The Architecture 🏗️ The system logic involves a feedback loop where the LLM perceives the browser state (screenshot + DOM tree), decides on an action, and executes it via Playwright. graph TD A[User Goal: Book Appointment/Download Report] --> B[LangChain Agent / Browser-use] B --> C{Decision Engine: GPT-4o} C --> D[Action: Click/Type/Scroll] D --> E[Playwright Browser Instance] E --> F[Hospital Portal UI] F --> G[Visual & HTML Feedback] G --> C F --> H[Download Lab Report PDF] H --> I[Structured Storage / RAG Pipeline] I --> J[Task Completed ✅] Prerequisites 🛠️ Before we start, ensure you have the following in your tech stack: Python 3.10+ Playwright (The backbone of browser control) Browser-use (The bridge between LLMs and browsers) OpenAI API Key (We'll use GPT-4o for its superior vision capabilities) pip install browser-use
AI 资讯
CKA Overview & Exam Pattern: The Kubernetes Certification That Actually Tests Your Skills
🚀 CKA Exam Overview: What Every Kubernetes Engineer Should Know Before Starting If you're working in DevOps, Cloud Engineering, Platform Engineering, or SRE, chances are you've heard about the Certified Kubernetes Administrator (CKA) certification. But here's what surprises most people: ⚠️ There are no multiple-choice questions. You get a real Kubernetes environment and must perform actual administrative tasks within a limited time. That makes the CKA one of the most practical certifications in the cloud-native ecosystem. 📋 CKA Exam Pattern Category Details Exam Type Performance-Based Duration 2 Hours Environment Live Kubernetes Cluster Passing Score ~66% Proctoring Online Remote Proctored Difficulty Intermediate to Advanced 🎯 Core Domains 1️⃣ Cluster Architecture, Installation & Configuration Cluster setup Control Plane components Certificate management Cluster upgrades 2️⃣ Workloads & Scheduling Deployments StatefulSets DaemonSets Jobs & CronJobs 3️⃣ Services & Networking Services Ingress DNS Network Policies 4️⃣ Storage Persistent Volumes Persistent Volume Claims Storage Classes 5️⃣ Troubleshooting Node failures Pod failures Control Plane issues Network troubleshooting Why CKA Matters in 2026 Modern organizations running workloads on AWS, Azure, and GCP increasingly rely on Kubernetes. A certified administrator demonstrates the ability to: ✅ Manage production clusters ✅ Troubleshoot incidents efficiently ✅ Maintain reliability and scalability ✅ Support cloud-native application deployments These skills directly align with DevOps and SRE responsibilities. My 90-Day CKA Challenge I'm beginning a structured 90-day CKA preparation journey. Over the next few months, I'll share: Study notes Lab exercises Troubleshooting scenarios Exam strategies Kubernetes tips & tricks Real-world DevOps and SRE learnings Discussion Time 👇 If you've already taken the CKA: 👉 What was the hardest section for you? If you're preparing: 👉 What's your biggest challenge right now? Let's learn
开源项目
Don't Skip the Dataset Description (I Almost Did, and It Would've Cost Me)
Started looking for a tourism dataset on Kaggle for a new project. Found one with real UNWTO data, but it only went up to 2022 — not enough for what I wanted (post-COVID trends). Then found a better-looking one: "Global Tourism & Travel Trends (2019-2024)," 24 upvotes, great coverage range. Almost picked it on the spot. Then I actually read the full description. Turns out it's synthetic — 10,000 generated records, not real recorded stats. Had to rename the whole project: from "Travel Recovery Analysis" to "Travel Behavior & Satisfaction Trends (2019-2024)" — same dataset, just honest framing. Still great for practice: 33 features, zero nulls, covers spend, satisfaction, eco-choices, transport modes. Anyone else ever almost build a project around the wrong assumption about their data? 👀
AI 资讯
Hillock: A brain-inspired, CPU-bound memory gate for local LLMs
Hi everyone, I've been hacking on a local personal memory system called Hillock . Honestly, it's very much a work in progress and it isn't some flawless breakthrough, but I wanted to see if we could build a lightweight, completely offline memory layer for local LLMs without the overhead of running a heavy neural vector database or wasting precious VRAM. The project is named after the biological Axon Hillock —the exact gatekeeper region of a human neuron that sums up incoming electrical charges and decides whether to fire (open the gate) or remain silent (block). How the architecture works: The Ground Truth (SQLite) : Stores hard facts as simple database triples (Subject-Predicate-Object) so the system has a solid symbolic foundation. The Synapses (Hebbian Plasticity) : Tracks which concepts co-occur during a conversation to dynamically build gradient-free associative weights. The Context (Hyperdimensional Computing) : Maintains a 10,000-dimensional leaky context vector that rolls, binds, and accumulates history. This helps the system resolve pronouns (like "he/she") and decide when to block a query to prevent hallucinations. The Honest Benchmarks (Yes, it breaks!) I wrote a tough, 30-sentence scientific benchmark with complex sentence structures and hard negatives (like asking what Einstein discovered when the text only mentions Curie discovering radioactivity and Einstein working with her). Running Qwen 1.5B locally on my computer, here is how it actually did: Extraction Precision : 10.6% Extraction Recall : 22.7% Retrieval Accuracy : 30.0% Gate Accuracy : 30.0% Why are these scores low? Because a tiny 1.5B model completely trips over complex English grammar during ingestion (it gets confused and creates weird predicates). However, the actual HDC vector-matching itself is incredibly stable. I enforce a Constant-Component-Count of exactly 3 components per fact, which balances the vector norms and keeps retrieval highly reliable once the facts are actually in the dat
AI 资讯
Blast Radius of an AI Agent's API Key: Score It in 40 Lines
The blast radius of an API key is not "did it leak." It's "if the agent holding it does the wrong thing, how much of your stack goes with it." A secret scanner answers the first question. Nothing in your toolchain answers the second one before an incident. So I wrote 40 lines that do, offline, from the permission metadata you already have. In short: the blast radius of an API key is set by its permissions, not by whether it leaked: scope width × environment isolation × lifetime × revocability. blast_radius.py reads that metadata (never the secret value, never the network) and scores each key 0–100. In my run a broad prod token hit 91/100 CRITICAL; a scoped key, 14/100 CONTAINED. Stdlib, keyless, deterministic. AI disclosure: I wrote blast_radius.py with AI assistance and ran it myself before publishing. Every score in the output blocks below is pasted from a real run on a synthetic fixture I'll show you — no real keys exist in it; every value is a placeholder like sk-FAKE-… . The incidents I cite ($82K, 9 seconds, 2,863 keys, 93%) are other people's , and I link each source next to it. I label which is which. A token that could delete the database, used to manage domains On April 24, 2026, a Cursor agent running Claude Opus 4.6 dropped a production database, and the volume backups with it, in about 9 seconds, on one API call . The team behind PocketOS wrote it up. The agent hit a credential mismatch, went looking, and found a long-lived Railway CLI token sitting in an unrelated file. That token had been minted to manage domains. But it carried blanket authority over the whole Railway account, volumeDelete included. No scope tied to an environment. No read-only mode. Recovery took the weekend ( The New Stack, 27 Apr 2026 ; The Register, 27 Apr 2026 ). Read that again, because the lesson isn't "the agent went rogue." The lesson is the token . A domain-management task does not need volumeDelete . The key was over-scoped before the agent ever touched it. The agent didn'
AI 资讯
How I Built a Read-Only SQLite MCP Server in Python (and Why Read-Only Matters)
Giving an LLM a database connection is one of those ideas that sounds great in a demo and terrifying in production. The agent writes a slightly-wrong query, and now you're explaining to your team why orders is empty. So when I wanted an AI agent (Claude Desktop, in my case) to answer questions about a SQLite database, I didn't want to hand it a read-write connection and hope for the best. I built a small MCP server that gives the agent read-only SQL access — and I made "read-only" mean it, with two independent layers of protection. Here's how it works, and the design decisions that matter. Full source: github.com/skycandykey1/mcp-sqlite-server (MIT). A 30-second primer on MCP The Model Context Protocol (MCP) is an open standard for connecting AI apps to tools and data. An MCP client (Claude Desktop, Claude Code, Cursor, ...) connects to MCP servers that expose three kinds of capability: Tools — functions the model can call ( query , list_tables , ...) Resources — read-only data the model can pull in (a schema, a file) Prompts — reusable prompt templates The Python SDK ships a high-level helper, FastMCP , that turns this into a few decorators. The interesting part isn't the protocol — it's the safety design behind the tools. Design: keep the dangerous part away from the protocol The first decision: the read-only safety logic has zero MCP dependency. It lives in a plain module ( db.py ) that knows nothing about MCP, so I can unit-test it with nothing but the standard library. The server ( server.py ) is a thin wrapper. That separation matters: the part that must never be wrong (write protection) is testable in isolation, without spinning up an MCP client. Two layers of write protection A single guard is a single point of failure. So write protection happens twice, independently. Layer 1 — open the database read-only at the engine level: import sqlite3 def connect ( path : str ) -> sqlite3 . Connection : """ Open a SQLite database in READ-ONLY mode. Any write raises Op
AI 资讯
AIchain Pool: Parallel Calls Instead of Sequential
You have 50 documents and you're running them through an LLM in a loop. The first one finishes at the 2-second mark. The fiftieth finishes at the 100-second mark — not because it's harder, but because it waited in line behind the other 49. Pool runs all 50 at the same time. The Problem With Loops Every developer who works with LLMs writes this code eventually: import os from yait_aichain.models import Model from yait_aichain.skills import Skill skill = Skill ( model = Model ( " claude-sonnet-4-6 " , api_key = os . getenv ( " ANTHROPIC_API_KEY " )), input = { " messages " : [{ " role " : " user " , " parts " : [ " Summarise in two sentences: \n\n {text} " ]}]}, ) documents = [{ " text " : f " Document { i } content... " } for i in range ( 50 )] results = [] for doc in documents : result = skill . run ( doc ) results . append ( result ) It works. It's readable. And it's painfully slow. Each LLM call takes roughly 2 seconds. Multiply that by 50 documents and you're staring at your terminal for almost two minutes. The calls are completely independent — document 37 doesn't need the result of document 12. Yet document 37 sits idle, waiting its turn. That's a scheduling problem, not a computation problem. I ran into this directly while building a task that pulled N files or links and produced a consolidated report. The sequential version was logically fine but just hemorrhaged time. I needed to fire everything at once without rewriting the Skill logic — no new prompt templates, no restructured code, just a different execution model. That's what Pool is. Pool: Parallel Map for LLM Calls Pool takes one Skill (or Chain) and a list of inputs , then launches all of them concurrently. Think of it as Array.map() where every element runs in parallel against an LLM. import os from yait_aichain.models import Model from yait_aichain.skills import Skill from yait_aichain.pool import Pool , DONE , FAILED skill = Skill ( model = Model ( " claude-sonnet-4-6 " , api_key = os . getenv ( "
开源项目
🔥 home-assistant / core - 🏡 Open source home automation that puts local control and pr
GitHub热门项目 | 🏡 Open source home automation that puts local control and privacy first. | Stars: 87,712 | 32 stars today | 语言: Python
开源项目
🔥 skypilot-org / skypilot - Run, manage, and scale AI workloads on any AI infrastructure
GitHub热门项目 | Run, manage, and scale AI workloads on any AI infrastructure. Use one system to access & manage all AI compute (Kubernetes, Slurm, 20+ clouds, on-prem). | Stars: 10,141 | 46 stars today | 语言: Python
开源项目
🔥 openinterpreter / openinterpreter - A lightweight coding agent for open models like Deepseek, Ki
GitHub热门项目 | A lightweight coding agent for open models like Deepseek, Kimi, and Qwen | Stars: 63,947 | 45 stars today | 语言: Python
开源项目
🔥 pytest-dev / pytest - The pytest framework makes it easy to write small tests, yet
GitHub热门项目 | The pytest framework makes it easy to write small tests, yet scales to support complex functional testing | Stars: 13,942 | 8 stars today | 语言: Python