Painel de Notícias

Tecnologia

7045 posts · 26 feeds · tópicos e interesse por Jev

Filtros
dev.to

Building a Telegram Bot for AI Video Generation: Architecture and Lessons Learned

Building a Telegram Bot for AI Video Generation: Architecture and Lessons Learned After months of building and iterating on a Telegram-based AI video generation platform, I want to share the technical architecture, challenges encountered, and lessons learned. The system consists of four main components: 1. Telegram Bot Interface Built with Python python-telegram-bot library Handles user authentication, session management, and conversation flow Supports text prompts, image uploads, and parameter adjustments 2. Model Aggregation Layer Integrates multiple AI video models: Kling, Runway, Seedance, Veo, Wan Unified API abstraction layer for consistent interface Model selection based on user preferences and prompt analysis 3. Queue and Processing System Redis-based job queue for handling generation requests Async processing to handle multiple concurrent users Progress tracking and status updates via Telegram callbacks 4. Storage and Delivery Generated videos stored in cloud object storage Signed URLs for secure delivery Automatic cleanup after 7 days Challenge 1: Rate Limiting and Throttling class RateLimiter: def __init__(self, max_requests, window_seconds): self.max_requests = max_requests self.window_seconds = window_seconds self.requests = [] async def acquire(self): now = time.time() self.requests = [r for r in self.requests if now - r = self.max_requests: wait_time = self.window_seconds - (now - self.requests[0]) await asyncio.sleep(wait_time) self.requests.append(time.time()) Challenge 2: Video Generation Timeout Challenge 3: Cost Management User experience matters more than features - The chat-based interface reduced onboarding time by 80% compared to traditional web apps Model diversity is a feature - Users appreciate being able to compare outputs from different models Async is essential - Synchronous processing cannot handle the latency of AI video generation Error handling needs to be user-friendly - Translate technical errors into actionable user messages Tele

DevIA
Interesse
dev.to

Multi-Tenant B2B SaaS Logging Backend: Search Costs for Silent Imports

A scheduled catalog import that never starts produces no failure event. For a multi-tenant B2B SaaS app, use a logging backend to investigate work that ran and a heartbeat monitor to detect work that stayed silent. Then attribute log volume by tenant and import run before choosing where those events live. TL;DR: for an e-commerce B2B SaaS, keep tenant_id, user_id, request_id, trace_id, import_id, and status as separate fields. A plain REST logging API is acceptable for operational search when low integration overhead and consolidated cost attribution matter. It is a poor fit for a strict audit or privacy-heavy system if per-user deletion, bulk export, subscriptions, or native alert delivery are mandatory. The tempting design is an import_failed event plus an alert. It catches explicit failures. It cannot report a scheduler that did not invoke the worker at all. Start with the billable unit of investigation, not a vendor dashboard. For this application, that unit is one scheduled import for one tenant: the requests it triggered, the user or service that initiated it, its trace correlation, and its final status. A backend that accepts structured events lets an operator search those identifiers without parsing prose. Cost attribution needs the same discipline. Attach tenant_id and import_id at ingestion, keep payload bodies and customer data out unless they are necessary, and measure event volume by workflow. This does not prove what a vendor will charge. It tells you which tenant and job created the volume before a shared monthly bill hides the answer. The tenant boundary is more important than query convenience. Derive tenant_id from the authenticated principal inside a trusted service. Do not let a browser choose it. A fast search that can cross tenant boundaries has failed the evaluation. I would inspect the live capability contract before testing any backend. This runnable probe finds the two verified logging routes without guessing an ingest body or search filter

InfraDev
Interesse
dev.to

My embedding model couldn't find "order 48207". Here's the one-line fix and what LongMemEval said next.

I maintain Agent Brain Hub, an open-source memory layer that several AI agents share. Last release I added real embedding models, and recall on my benchmark went from 88.5% to 100%. Then I wrote a harder test, and the model fell over on something any keyword search gets right. A customer has twelve shopping conversations, one per order: My order ORD-48200 for a blue backpack hasn't arrived yet My order ORD-48201 for running shoes hasn't arrived yet … My order ORD-48211 for a water bottle hasn't arrived yet Then another agent asks the memory: "what is going on with order 48207". Retrieval Finds ORD-48207? Local feature hashing (lexical) ✅ bge-m3 embeddings ❌ To the embedding model all twelve conversations mean the same thing ("a late order"), so they scored almost identically, and recency decided which four made it into the context. The one distinguishing token, 48207, is exactly what dense embeddings blur. Hashing vectors are crude, but they match exact tokens. My first fix took whichever signal was stronger: max(model, lexical). It still failed. The model's score for every order (~0.6) was above the lexical score of the right one, so the max was the model score everywhere and nothing changed. // Hybrid (CombSUM): meaning + wording const lexical = Math.max(0, cosine(qHash, item.hashVec)); return modelVecAvailable ? Math.max(0, dot(qVec, item.vec)) + lexical : lexical; An item that matches in meaning and wording now beats items that are merely on topic. The sum is never below either signal, so paraphrase matches ("Can I drive to the airport?" → "no car for 3 days") keep the score that made them work. I added an exact_match category to the benchmark, with order numbers that differ by one digit, with and without the ORD- prefix, plus device model names. A unit test proves the fix: it fails if you revert it. With bge-m3 on all 25 scenarios: 96% pass, 100% recall, 0% leaks. My own scenarios only compare versions of my own project. So v0.4.0 also runs LongMemEval-S (MIT):

IADev
Interesse
dev.to

MCP connection errors explained: 404 on /sse, 406 Not Acceptable, session 400s, 402

MCP Streamable HTTP is one URL. The client POSTs JSON-RPC to it and may open a GET stream on the same URL; nothing else is part of the address. Most connection failures we see in our own server log are a client talking to a different address than the one it was given, or sending the wrong headers. Here is what each status means and the fix, with the exact messages the official TypeScript and Python SDKs send. /sse, or with /mcp appended The earlier HTTP+SSE transport (protocol revision 2024-11-05) opened a GET to an SSE URL and read an endpoint event that named a second URL for POSTs. Streamable HTTP (2025-03-26 and later) replaced both with a single URL. A client that still speaks SSE-only, or a bridge that guesses, appends /sse and gets a 404 from any Streamable HTTP server. Some clients also append /mcp to a URL that already ends in the server path. Fix: use the URL exactly as published. For a client that only speaks stdio, run a bridge such as npx mcp-remote https://tanod.dev/mcp --transport http-only so it does not fall back to SSE. For Tanod, every server is Streamable HTTP: https://tanod.dev/mcp and the focused servers such as https://tanod.dev/mcp/docs; /mcp/docs/sse, /mcp/docs/mcp and /api/mcp are all 404. A POST must carry Accept: application/json, text/event-stream, because the server may answer a request either with one JSON body or with an SSE stream. Both SDKs reject anything else with this message. A GET (the optional server-to-client stream) must accept text/event-stream. Curl and most HTTP libraries send Accept: */*, which some servers take and others do not; set the header explicitly. The request body is JSON-RPC and must be sent as Content-Type: application/json. Form encoding, a missing header, or text/plain from a quick script all produce this. A stateful server expects an initialize request first. Its response carries an Mcp-Session-Id header, and the client must send that header on every later request. Calling tools/list before initialize, or

Dev
Interesse
dev.to

EP03: Content sovereignty — control it yourself, the ultimate moat

Episode 3 of 20 in the **PPCDN Low-Latency Live Streaming Course* — building a self-hosted, low-latency live-streaming CDN from protocols to global delivery. Originally published on the PPCDN docs site; see the full course index for all episodes.* Recap EP02 "The self-hosted CDN answer: PPCDN architecture overview" ended by naming the principle of content sovereignty and deferring the trade-offs to this episode Next EP04 "Transport showdown: RTMP / SRT / WHIP" By the end, the viewer should be able to: Break "content sovereignty" from a slogan into three concrete, judgeable risks: takedown risk, throttling risk, and data-sovereignty risk. State how far self-hosting can respond — not "self-hosting = no censorship" but "decision-making moves from a third party to yourself": two different propositions. Honestly list what self-hosting makes you responsible for — this episode is about trade-offs, not a one-sided list of benefits. Last episode closed with: "under your control" is a harder moat than any performance number. EP01 §2.3 said "handing your lifeline to a third party you can't control". This episode splits When you depend on a third-party live/RTC cloud, whether your business keeps running ultimately terms that let the platform suspend or terminate an account , triggered by content More common and harder to notice than a plain takedown is throttling: a third party can adjust This is the most easily overlooked, yet consequential: where servers that store, process and forward but not the only one. The operator's location, where the data controller/processor This must be stated clearly, or the whole episode is marketing: self-hosting does not exempt you ; self-hosted or third-party, your business still follows the Architecturally, PPCDN already has capabilities that directly serve "you decide where data lands": Physical deployment location is entirely your own choice, and the isolation boundary is set by the node pool: Origin/Edge nodes can be deployed at whatever ph

Infra
Interesse
dev.to

The AWS savings nobody can touch: legacy systems

The second category of AWS caveats is the legacy problem And legacy doesn't just mean old It means: built by people who are no longer here, in ways that are no longer documented, for reasons that are no longer clear, and that everything else has since been built on top of I've seen EC2 instances running since 2017 that nobody will touch. Not because they're critical in a way anyone can articulate. Because they're connected to enough other things that removing them feels like pulling a thread that might unravel something important The fear is not irrational. It's based on past experience. Someone removed something once and something else broke. Now nothing gets removed The cost of that conservatism is real. Every month. Indefinitely Here's how I navigate legacy in AWS accounts First: observe before acting. Look at network traffic, API calls, CloudWatch metrics. Does anything talk to this resource? Is anything depending on it in a measurable way? Often the answer is no. The fear was about unknown dependencies and the monitoring shows there are none Second: tag it with intention. If you can't remove it yet, tag it with a date and a note. "Reviewed 2024-Q1. No observed dependencies. Candidate for removal." That tag is a commitment to revisit. It also means the next person who looks at this has context instead of starting from scratch Third: isolate before removing. If the resource is in a VPC, you can often restrict its network access before removing it. Leave it running but disconnected. Wait 30 days. If nothing complains, the dependency was a ghost Legacy systems in AWS are expensive partly because of what they cost to run and partly because of what they cost to think about Every hour an engineer spends being careful around an undocumented legacy resource is an hour not spent building something The documentation debt has a bill too. It just doesn't show up in Cost Explorer

InfraDev
Interesse
dev.to

I Gave My AI Agents an Org Chart

I Gave My AI Agents an Org Chart Most agent frameworks hand you a pile of scripts and wish you luck. You wire up three agents, write the orchestration glue yourself, and six weeks later you have a system nobody can explain. I kept running into this, so I built something with a different shape: a company. It is called Botropolis. Twenty specialist agents across ten departments, one CEO orchestrator, and a training pipeline so each agent can eventually get its own fine-tuned model. It is open source, MIT licensed, and it runs with no API keys. Companies figured out coordination centuries ago. When work gets complex, you do not throw twenty generalists into a chat room. You create departments, give people job titles, and let a manager break big requests into pieces. Botropolis is that idea in Python. You ask Manoj, the CEO, for something. He looks at the request, decides which departments need to be involved, and routes the work. Research goes to Scout, code goes to Coder, the numbers go to Analyst. Each agent has a YAML spec: name, title, specialty, tools it may call, example tasks. Anyone reading the repo can see who does what, the way an org chart tells you who owns what. The roster covers ten departments: research, health, finance, code, data, legal, marketing, ops, security, and support. Some highlights: Teaming. One agent alone is fine, a team is better. You name the agents and the rounds, and they draft, critique, and revise in sequence. Each agent sees everything its teammates produced before it. Manoj writes the final synthesis. Real tools, no vendor lock-in. Agents with toolkits run a think-act-observe loop over a plain-text protocol. No provider function calling involved, so it works with OpenAI, Anthropic, Gemini, Ollama, or a model you trained yourself. Fourteen tools ship in the box: web search, shell, file tools, Gmail, calendar, a shared company notebook. A web UI with no build step. Plain HTML, CSS, and JS served by the same FastAPI process. Chat with

IADev
Interesse
dev.to

Seven Python FastAPI Node.js Mixed Stack Capture Schemas for Pricing Rollouts Explained

The constraint is incident reconstruction. For a Python FastAPI and Node.js mixed stack handling a pricing rule released to 2% of checkout traffic, I need to identify the rule revision, the request that saw it, and the first failing service. I would use one seven-field event envelope, carry a W3C trace ID through every hop, and send events to an asynchronous capture endpoint that can be replaced later. This keeps a FastAPI catalog service and Node.js promotion service comparable without making either language the center of the design. A count of 500 responses is not enough. The useful unit is a linked event. That is the decision. The failure mode I design for is partial success. The catalog can return 200, the promotion service can return a price, and the payment adapter can reject the amount several hundred milliseconds later. If those services emit independent records, an alert groups them as three unrelated errors. The shared envelope lets me reconstruct the causal order: the same trace_id ties the calls together, operation identifies the boundary, and rule.revision shows whether the new branch was involved. I can then compare one failing trace with a successful trace from the same 2% cohort. That comparison is usually more useful than a global error-rate chart, because the chart hides the flag decision and the item version. The collector does not need to understand pricing. It only needs to preserve fields, apply access controls, and make the event searchable before the next release. Define the observation contract before deployment. Every producer emits event_id, occurred_at, trace_id, service, operation, rule, and error. The rule contains the flag key, evaluated variant, and revision. The error contains a stable type and an operator-safe message. A stack is optional and should follow the data policy. Do not put payment tokens, raw request bodies, or email addresses in this event. OWASP's Logging Cheat Sheet treats sensitive-data handling as part of the logging

DevInfra
Interesse
dev.to

React Frontend Error Tracking with window.onerror Through a Backend Intake

TL;DR: React frontend error tracking works best with a small, scrubbed browser envelope and a backend collector that retains only the evidence needed to reconstruct a learner report. For a solo edtech product, that is the least complex path to answering why one learner saw a broken lesson without collecting a transcript of their session. | Choice | Reconstruction value | Privacy exposure | Operating burden | Recommendation: use the third row as the default. Counters tell me that a release is unhealthy; a bounded event tells me what a learner encountered, where, and which deployed build produced it. Full session capture is a separate decision with a much larger privacy review. The useful unit is not an error message. It is a reconstruction record: an exception fingerprint, a cleaned stack, the release and environment, a route template, a timestamp, and a request or support correlation key that cannot be turned back into a learner identity. The exact schema is the product decision. Small on purpose. Start with the question support will actually ask: "A learner could not submit a quiz at 09:14. Can we tell which code path failed, in which release, without reading their answer?" A stack by itself rarely answers that. It needs deployment context and a narrow description of the action. For this workload I keep two identifiers separate. eventId identifies the browser occurrence. incidentKey is a random, short-lived key created when the learner opens a support flow; it can be shared with support, but it is not their account ID or email. The collector should reject fields it has not explicitly allowed. That awkward constraint pays off when a future UI change adds a new value to an error object. The two criteria that matter most are reconstructability and collection boundaries. Reconstructability means an engineer can group the event with the correct source maps, deployment, route, and timestamp. It also means a report from 09:14 can be compared with the release that was live

Dev
Interesse
dev.to

AI Coding Assistants Prompt Injection Attacks: 2026 Security Outlook

Originally published at nlocoding.com dataconomy.com). AI coding assistants are now prime targets for prompt injection attacks The last 12 months have seen a hard pivot: attackers are exploiting AI coding assistants at industrial scale. Prompt injection is ranked LLM01 in the OWASP Top 10 for large language model apps (vectra.ai), putting it above data leakage or privilege escalation. This isn’t theoretical; GitHub Copilot, Microsoft Copilot, and Cursor IDE all suffered critical vulnerabilities between 2025 and 2026, each scoring above 9.0 on the CVSS. The message from the field is unavoidable: AI coding assistants are a real attack surface, and ignoring prompt injection invites disaster. 50–84%Prompt injection attack success rates (vectra.ai) Prompt injection attacks are the most critical security issue for large language model-powered coding assistants. OWASP ranks prompt injection as LLM01, the highest risk, and real-world attack success rates range from 50% to 84% (vectra.ai). That’s not a margin for error—it’s an open invitation. These attacks routinely bypass traditional security layers, manipulating the assistant into executing malicious commands or leaking sensitive data. If you’re using an AI coding assistant and haven’t made prompt injection your top concern, you’re in for a rough awakening. ⚠️Common Mistake: Assuming your AI coding assistant is secure by default overlooks prompt injection vulnerabilities. This is the flaw attackers count on. Critical vulnerabilities have been exploited in flagship AI coding tools. Microsoft Copilot (CVSS 9.3), GitHub Copilot (CVSS 9.6), and Cursor IDE (CVSS 9.8) all suffered prompt injection attacks between 2025 and 2026 (vectra.ai). Attackers generated malicious prompts that resulted in credential and cryptocurrency theft. Even newer entrants aren’t immune: security researchers demonstrated that Manus AI agent could be compromised by a single email containing a disguised malicious prompt (techradar.com). The lesson is pa

SegurançaIA
Interesse
TechCrunch

Google brings agentic AI to Gemini, starting with businesses

Google is turning Gemini into an AI agent that can plan, execute tasks, and work across business apps and systems. The agent can delegate work to subagents, use multiple AI models, and even gets its own workplace identity, complete with an email address.

IA
Interesse
BleepingComputer

OAuth grants pile up faster than you can review them. Here's how to keep up.

OAuth grants create data highways between SaaS apps, AI agents, and other tools. And, they are multiplying faster than any security team can review them. As the recent Klue breach showed, attackers are taking notice and exploiting forgotten OAuth grants to gain access to corporate data. This article covers why OAuth risks are so hard [...]

Segurança
Interesse
dev.to

Six Git Checks After an AI-Assisted Change — And What They Cannot Guarantee

A coding assistant changes the two files you asked it to edit. The diff looks reasonable. Is the next Git operation safe to proceed? Not necessarily. You might be in the wrong repository. An extra file might already be staged. The branch or configured push destination might have changed. Or the secret scanner might have failed to run at all. These are not necessarily mistakes in the generated code. They are mismatches between the workflow you authorized and the Git state that actually exists. I built a small, public reference Git Safety Harness to check selected mismatches before a later operation. It is a PowerShell-based, fail-closed workflow control—not a sandbox, not an independent enforcement boundary, and not a guarantee of safe AI-generated code. Suppose the authorized work is: Edit docs/article.md and public/article.html in a particular repository. Stay on main. For the next operation, stage only docs/article.md. Check the configured push URL for origin against an explicitly approved URL. Run a staged-diff secret scan before any separately authorized push. The harness does not invent these expectations. A human or an authorized workflow must define them first. The harness then compares selected observed Git state against them. Check Question before proceeding Example of a reason to stop Repository Root Is this the intended Git repository? The command is running in another valid checkout. Write Set Are observed tracked changes and non-ignored untracked paths within the allowed set? README.md changed even though it was not authorized. Stage Set Does the actual Git index contain only explicitly allowed staged paths? An unrelated file was staged earlier. Branch Is the current symbolic branch the expected branch? HEAD is detached or the branch differs. Push URL Does the selected remote have exactly one configured push URL, matching the approved URL? origin points somewhere else, or has multiple push URLs. Secret Scan Can Gitleaks run and accept the staged diff? G

Dev
Interesse
dev.to

How to Build Transportation Management Solutions Around Real-Time Inventory Events

A warehouse can show 500 units available while the transportation system is still waiting for the previous stock update. That inconsistency can cause duplicate allocations, failed dispatches, incorrect carrier instructions, and delayed fulfillment. Transportation Management Solutions become difficult to scale when inventory, warehouse, order, and shipment systems exchange state through synchronous API chains. A better approach is to treat inventory changes as events and let transportation workflows consume those events asynchronously. This article explains how to design that architecture using Node.js, Python, PostgreSQL, Docker, and AWS services. For teams evaluating inventory and warehouse management solutions, the same pattern can connect warehouse operations with dispatch planning without tightly coupling every service. The system assumes four core domains: Inventory Service: Owns stock quantities, locations, reservations, and adjustments. Order Service: Creates customer or internal fulfillment requests. Transportation Service: Assigns carriers, routes, shipment windows, and delivery status. Warehouse Service: Handles picking, packing, scanning, staging, and dispatch. A common mistake is making the order service directly call inventory, warehouse, carrier, notification, and transportation APIs before returning a response. As the number of integrations grows, one slow dependency can increase the latency of the entire transaction. An event-driven design separates the transaction from downstream processing: ┌─────────────────┐ │ Order API │ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ Inventory DB │ └────────┬────────┘ │ StockReserved │ ▼ ┌─────────────────┐ │ EventBridge/SQS │ └───────┬─────────┘ │ ┌────────────┼────────────┐ ▼ ▼ ▼ Warehouse Transportation Notification Worker Worker Worker AWS documents a similar supply-chain pattern where warehouse stock changes publish events that can update downstream systems and trigger procurement workflows. There is also a

Dev
Interesse
The Verge

Google is launching a one-stop Gemini agent for your work tasks

Google is launching a "universal" Gemini AI agent that can work across apps and devices in the background. The tool, announced as part of the Gemini at Work event on Thursday, will be available within the Gemini Enterprise app, allowing users to chat with the Gemini agent and assign it tasks from a single interface. In addition to having Gemini work directly inside Workspace apps like Gmail, Drive, Docs, Sheets, Calendar, and others, users can interact with the agent from their mobile device, desktop computer, the web, and third-party apps like Slack or Microsoft 365. Since it runs in the cloud, Gemini will maintain the same context across … Read the full story at The Verge.

IAMobile
Interesse
dev.to

Google's October Update Gives Car Makers a Paintbrush, and I Have Mixed Feelings About It

Google dropped the October 2026 Google System Update a few days ago. Buried inside Google Play Services v26.39 is something that actually matters if you care about Android Automotive: OEM Design Tokens. Finally. Car manufacturers can consistently customize the color themes of Google apps running on their infotainment systems without having to hack together janky resource overrides that break on the next Play Services update. I'm Artem Garazha. I'm a solo Android developer, I ship apps on Google Play, and I run the YouTube channel Pin Up Retro Manner where I walk through my builds. I pay attention to this stuff because it directly affects how apps look and behave across Android surfaces. When Google changes how theming works on a platform like Android Automotive, it ripples out to every developer who has to test against it. You don't get to ignore it. OEM Design Tokens are Google giving car manufacturers a structured theming system for Google apps on Android Automotive OS. Before this, manufacturers either lived with Google's default Material You colors looking completely wrong against their custom dashboard UI, or they hacked together their own color overrides. Now they get a proper token library. Three components. A static library that provides APIs to access OEM token values and lets apps opt into overriding token references with OEM values. A shared library that defines the library name, a boolean called enable_oem_tokens, and an OemStyle that carries the actual color values. And then manufacturers can create their own override of the shared library with their own package name and signing certificate. BMW gets com.bmw.sharedlib. Mercedes gets com.mercedes.sharedlib. Nobody steps on anybody else. The token values themselves live in a style called OemStyle. It's standard Android resource XML: #B0C5FF #002B76 #003FA4 #D9E2FF The clever bit: manufacturers can layer Runtime Resource Overlays (RROs) on top of this to change token values dynamically. A car could switch

MobileDev
Interesse
dev.to

The full pg_duckdb extension on Azure Database for PostgreSQL

In my previous post, Amazon Aurora's analytics being DuckDB — a side-by-side comparison with pg_duckdb, I examined Aurora Analytics in detail alongside pg_duckdb. I noted that the pg_duckdb extension, installed on a PostgreSQL container, offers more features. For this article, I configured it on Azure Database for PostgreSQL (Flexible Server), a managed service running the community PostgreSQL with popular open-source extensions. I've run this demonstration on Azure Database for PostgreSQL flexible server newly provisioned in Canada Central region, with 2 vCores, 4 GiB RAM, 32 GiB storage, and PostgreSQL 18.6: The pg_duckdb extension is a shared_preload_libraries extension, so two settings are needed. First, allow-list it, then add it to the preload libraries and restart. The cover image of this article shows the manual way in the portal's Server parameters, with two clicks on the checkboxes, or you can do the same via the CLI: # allow-list the extension az postgres flexible-server parameter set \ --resource-group --server-name \ --name azure.extensions --value pg_duckdb # load the library (append to whatever is already there), then restart az postgres flexible-server parameter set \ --resource-group --server-name \ --name shared_preload_libraries --value " ,pg_duckdb" az postgres flexible-server restart \ --resource-group --name If you only do the first step, CREATE EXTENSION fails with a clear hint: ERROR: pg_duckdb needs to be loaded via shared_preload_libraries HINT: Add pg_duckdb to shared_preload_libraries. After the restart, with a normal login, you CREATE EXTENSION in the database where you want to run DuckDB functions: postgres=> CREATE EXTENSION pg_duckdb ; CREATE EXTENSION postgres=> \dx *duckdb* List of installed extensions Name | Version | Default version | Schema | Description -----------+---------+-----------------+--------+----------------------------- pg_duckdb | 1.1.0 | 1.1.0 | public | DuckDB Embedded in Postgres (1 row) That's how you load an ext

InfraDev
Interesse
dev.to

Build an AI lead generation agent with the OpenAI Agents SDK and Zenrows

This article was originally published on the Zenrows blog. In this tutorial, you'll build a lead generation agent that reads a bot-protected business directory, pulls every company listed on the page, enriches each one from its own website, and scores it against your ideal customer profile (ICP). You'll need Python 3.10 or above, an OpenAI API key, and a Zenrows API key. The OpenAI Agents SDK runs the agent loop, and its @function_tool decorator turns plain Python functions into tools. Zenrows Fetch handles the step that usually breaks, which is getting the page at all. In the test run, one directory page produced 78 companies, and the agent scored each one in under 20 seconds. The complete code is on GitHub if you'd like to clone it and follow along. You need Python 3.10 or above. You need an OpenAI API key, which the agent, the extraction tool, and the scoring tool all use. Get one from your OpenAI developer dashboard. You need a Zenrows API key to retrieve the full contents of web pages. Create one on the signup page. Install the dependencies. python3 -m pip install openai-agents openai requests pydantic python-dotenv The SDK runs the agent, requests makes the Zenrows calls, pydantic defines the tool schemas, and python-dotenv loads your keys. Create a .env file in your project root with your OPENAI_API_KEY and ZENROWS_API_KEY, and add .env to .gitignore so the credentials never reach version control. The work splits into four tools, and each one does a single job. Tool Input Output Why it's separate fetch_page a URL the page as Markdown it's the only job that touches the network, so retries and errors live in one place extract_leads Markdown plus the source URL Lead records it runs in chunks because a full directory page exceeds one reliable extraction call enrich_lead a company and its domain enrichment signals from the company's site it makes one fetch per nav link, so it drives the cost and is worth isolating score_lead enriched lead plus the ICP a score from

IADev
Interesse
dev.to

Clean Includes, Separate Grades: Probing AI C++ Patches Outside the Driver

A composite night-build scene, not a measured incident from this account, still matches a failure C++ evals keep shipping. A grader accepted a patch just after 02:00. Every golden assertion passed, and the diff touched only inventory.h plus inventory.cpp. The next consumer file included that header and nothing else. Compilation stopped because std::string was unknown. The eval driver had included , , and a project prelude before it loaded the header under test. The patch looked finished because the driver had already done the include work. That failure mode is quiet. Functional graders never see it. A standalone translation-unit gate does. The driver is a convenience program. It exists to call functions and check return values. It is a poor witness for header hygiene. A model can emit a public header that uses std::vector without including , then still compile, because the driver's first lines already pulled that header in. The same blind spot hides missing forward declarations, macros supplied by a unity prefix, and a precompiled header a free-standing consumer will never receive. A passing driver compile therefore proves less than the status line suggests. A useful grade separates two checks. One check asks whether behavior matches the golden cases. The other asks whether a stranger can include the public header in a clean translation unit and compile a tiny call. A single green exit code blends those checks and hides the second failure. The files below are a proposed workflow. They are not a recorded run, and they are not a benchmark. The operator points them at a patch directory, a public-header list, and a compiler command. That command can target a local toolchain or a clean remote tree. Keep the probe beside the existing functional grader, not inside it. public_headers.txt names only headers a downstream file is allowed to include: include/inventory.h The broken header that motivates the gate looks like this: #pragma once namespace inventory { struct Item { I

Dev
Interesse
dev.to

I open-sourced a linter for MCP tool descriptions

AI agents choose an MCP tool by reading three things: its name, its description and its input schema. Many servers write those descriptions like docstrings, for a human who already knows why they opened the file. An agent with thirty tools in its context doesn't know that. It needs to know when to use a tool, what comes back, and which lookalike to use instead. Forecall's linter checks exactly that, and its code is now public under Apache-2.0: github.com/forecall/forecall-cli. Two commands. The first starts a server and saves its tools/list; the second scores it. npx forecall dump -o memory.json -- npx -y @modelcontextprotocol/server-memory npx forecall lint memory.json Here is part of the report for the official memory server (0.6.3): Average score 43.8 / 100 Tools 9 Confusable pairs 1 Across the server Major confusable_pair delete_entities and delete_relations are easy to mix up. Description similarity 0.62 · Name similarity 0.33 39 / 100 delete_relations Purpose 6/20 · When to use 0/20 · Arguments 18/25 · Return value 8/15 · Constraints and side effects 7/10 · Examples 0/10 Major restates_name The description only restates the name (7 words). Major too_short The description is too short (7 words). Major no_usage_context Says nothing about when to use it, or when not to. Two delete tools with similar descriptions, and neither says when to use it. That's the kind of pair where an agent deletes the wrong thing. I've suggested rewrites for them in an issue on the servers repo. For a remote server, pass its URL instead, with --header "Authorization: Bearer …" if it needs a key: npx forecall dump https://example.com/mcp -o tools.json Each tool gets a score out of 100, in six parts: Part Points What it looks for Purpose 20 What the tool does, beyond restating its name When to use 20 When to use it, and which similar tool to use instead Arguments 25 Each argument described, typed and marked required Return value 15 What comes back, in an output schema or the description

IADev
Interesse
dev.to

Close the Loop: Chatbot Analytics That Turn Misses Into Fixes

Many chatbots stall for the same reason. Unanswered questions build up and nothing changes. Teams ship a release and move on. Users try again and give up. The way out is simple. Treat every miss as a signal. Capture it in a standard way. Decide whether it was noise or a real gap. Turn real gaps into small updates in guardrails or knowledge. Run that loop every week. Measure how fast it moves. This gives the team a way to test whether focused fixes help before changing models. Analytics only works if the trail is short and consistent. Capture the user message, the decision the assistant made, the sources it consulted, the final answer, and any fallback it used. Record time to first token and time to full answer. This gives a clear picture of what happened and why. Long logs feel thorough but slow teams down. A compact record gets read and acted on. The question is in scope and relevant, yet the reply has no supporting citation or source A fallback was needed to finish the turn such as clarify, retrieve, or hand off Confidence is below your threshold or the reply uses hedging language like "not sure" or "I think" The user reasks the same thing within a short window Retrieval returns nothing useful or cannot locate the expected document The reply conflicts with the current knowledge base Do not count out of scope or non relevant messages as unanswered. Those belong to the guardrail stream. Use one rule set across teams so the dashboard stays trusted. Guardrails are the decision layer that determines whether a request should be answered, how it should be answered, or declined. They protect scope, safety, policy, and data hygiene before the model spends tokens. They can be rules, a policy engine, an ML classifier, or a hybrid. Keep them alive by sampling borderline cases each week, correcting mistakes, adding examples, and tracking false blocks and false allows so thresholds stay fair. Not every miss deserves work. First filter out non relevant items such as spam, off to

IA
Interesse
dev.to

Your Is Invisible to AI Agents

I Found Out What an AI Agent Actually Sees When It Looks at My Buttons Imagine describing your app to someone over the phone. You can't send a screenshot. You just read out what's on the page: "There's a heading that says Checkout. A text box for email. A button that says Place order." That's roughly what an AI agent gets when it uses your app. I wanted to know exactly what that description looks like, so I built a page with nine different buttons and printed what the agent receives for each one. Some of it surprised me. Browser agents come in two flavors. Some look at pictures. They take a screenshot and click where the button appears. Claude computer use and OpenAI's computer-using agent work this way. Some read a description. They never see pixels at all. They get a text list of what's on the page — each thing's type, its label, and its current state. Then they act on items from that list. browser-use, Stagehand, Microsoft's Playwright MCP and Vercel's Agent Browser all work this way. The second group is growing fast, for a boring reason: a text description is way smaller than a screenshot. Cheaper per click, and more precise about what got clicked. Over a fifty-step task, that adds up. This article is about what that description contains. I used Playwright 1.56 and Chromium 141 to generate it. I expected a to be completely missing from the list. It isn't. Here's what came back: generic [ref=e2] [cursor=pointer]: Place order The agent can see it, and can click it. It even knows the mouse cursor turns into a pointer, so the CSS leaks through a little. What it doesn't know is what the thing is. "generic" means "some box." So the agent sees a box with the words "Place order" in it, and a pointer cursor, and has to work out that this is probably a button. Compare the real button: button "Place order" [ref=e3] [cursor=pointer] That one says it outright. It's a button, and it's called "Place order." No working out required. That's the whole difference: one is a fact, t

IADev
Interesse
dev.to

The “Ghost Payment Method” Dilemma: How Expired Client Cards Silence Critical Renewal Notices

Digital agencies and web development firms face a recurring operational hazard that rarely gets attention until something breaks: the Ghost Payment Method. Picture this scenario. A web agency designs, builds, and maintains an e-commerce store for an enterprise client. The agency registers domain names and sets up hosting, SaaS plug-ins, and SSL/TLS certificates on auto-renewal. To avoid carrying third-party hosting charges on its own books, the agency puts the client’s corporate credit card on file with vendor accounts (AWS, Cloudflare, Namecheap, WP Engine, or custom SaaS integrations). Months later, the client’s corporate card expires, is compromised, or is replaced after a routine bank update. The client’s finance team updates its internal records and perhaps its main operational software, but forgets to tell the web agency. To the agency, everything looks normal. The original card still shows as the “card on file” inside vendor accounts. That payment method has become a ghost: it looks valid in the vendor’s database but can no longer be charged. When the annual domain or hosting renewal arrives, the charge fails. If the vendor account is tied to a former employee’s mailbox, an unmonitored info@ address, or a noisy shared inbox, the failure notices go unread. Depending on the vendor and the TLD, the site can then go dark, email can stop, or the domain can slide into a paid recovery window and eventually be released for anyone to register. When mission-critical infrastructure goes offline, clients rarely blame the registrar or their own accounting team. They blame the web agency. This guide explains why silent auto-renew failures happen, what the domain expiration lifecycle looks like in practice, and which protocols agencies can adopt to close the gap, from account updater services to quarterly card-health checks. Payment failures like this don’t trigger alarms because the information has to pass through four parties, and each one assumes another is watching. 1.

Infra
Interesse
dev.to

AI Test Agents Need a Mailbox Lease

AI agents are getting good at running developer workflows. They can create a test user, trigger a signup, inspect a verification message, and report whether the flow worked. The awkward part is usually not the prompt or the model. It is the mailbox. An agent that uses one shared inbox quickly inherits hidden state: old messages, another job's verification link, rate limits, and a cleanup rule nobody wrote down. The result looks like an AI problem, but it is really a test-fixture design problem. I like to model each test mailbox as a lease. The agent receives a mailbox for one run, knows what it is allowed to do, and must return or expire it when the run ends. This mental model makes automation easier to reason about, whether the mailbox is a local fake service or part of a best throwaway email workflow. An agent is often allowed to retry. That is useful for transient browser or API failures, but retries make shared email state dangerous. A second attempt may find the first attempt's message and report a false pass. A later task may also read a token that belongs to an earlier user. The agent don't need a permanent inbox. It needs four predictable answers: Which run owns this mailbox? Which messages count as evidence? When does the lease expire? What information is safe to keep after failure? The same questions apply when a developer searches for a temp mail so service for quick manual checks. In an automated workflow, though, the lease has to be explicit enough for a tool call and a cleanup job to enforce it. A small lease record can be more valuable than a complicated agent prompt. Store it next to the test run, not only in the agent's conversation: { "run_id": "signup-1842", "mailbox_id": "qa-1842@example.test", "created_at": "2026-10-08T06:00:00Z", "expires_at": "2026-10-08T06:15:00Z", "allowed_events": ["verification_email"], "status": "active" } The run_id prevents one job from claiming another job's messages. The event allowlist keeps an agent from treating an

IADev
Interesse
dev.to

Reconstructing Edtech Incidents — Node.js Health Endpoint, Cron Job Uptime Monitoring, Heartbeat Checks

Short answer: give the Node.js app a cheap /health endpoint, use scheduled metrics for API uptime monitoring, and send a separate heartbeat check after every cron job or queue run. For an edtech backend, that is the least complex arrangement that can answer both "was the API reachable?" and "did the enrollment job run?" Do not treat those as the same question. A healthy web process cannot prove that a nightly roster import happened. The bill is mostly made of evidence volume: events per reporting interval times the number of dimensions times retention. Before choosing a product, reduce that term. Aggregate routine success traffic, retain failure evidence with stable correlation identifiers, and keep heartbeat history for scheduled work. The deliberate loss is per-request detail for uneventful traffic. During an incident, that means reconstructing the shape of normal activity from summaries rather than replaying every request. Consider a hypothetical learning platform with 50,000 lesson sessions per day. If it emits one event for every successful session, that is 50,000 daily records before retries, health probes, or background jobs enter the picture. If it instead publishes four one-minute aggregates—attempts, successes, failures, and latency—the upper bound is 5,760 metric points per day for that service. The arithmetic is an example, not a benchmark, but it exposes the lever: aggregation interval and label cardinality usually matter more than shaving bytes from JSON. Keep the labels boring. Route, status class, deployment identifier, and region can help reconstruct an outage. Student ID, course ID, email address, and a raw error message can create unbounded series and turn a technical evidence store into a compliance liability. In an education system, the latter deserves extra scrutiny because operational data can become identifiable student data surprisingly quickly. For each customer incident, the evidence chain should answer four questions: Could an external ca

InfraDev
Interesse
The Verge

Microsoft is giving Copilot more control over Windows and your files

At today's Windows and Surface event, Microsoft showed off an upgrade to its Copilot AI system that will give it access to local files on your PC and the ability to take actions across the OS. It's part of an idea Microsoft is calling "Hybrid Intelligence," where apps and tools rely on a mix of local and cloud AI models to accomplish tasks efficiently. To show off how Hybrid Intelligence works, Jacob Andreou, Microsoft's EVP of Copilot, walked through a video demo on stage asking Microsoft's Autopilot tool to help with filing taxes. Andreou told the AI agent that he got an email from his accountant and asked Autopilot to get her what she … Read the full story at The Verge.

IA
Interesse
dev.to

Designing Asynchronous Agent Runtimes: Stateful Queues and Decoupled Execution

Most AI agent tools assume you will sit and watch them run in a live chat window. But synchronous agent sessions are fragile. If your browser tab closes or your connection drops, the entire execution state is lost. By decoupling the execution engine into a background daemon with stateful checkpoints, we can build agents that run reliably in the background. However, this architectural pattern introduces a massive tradeoff. Running a continuous local API server requires robust local process supervision, and debugging non-deterministic agent runs that fail silently in the background becomes a significant chore. Transitioning to an asynchronous, inbox-style queue model is the first step toward making local-first agents practical for real engineering workflows. Read the full article: Designing Asynchronous Agent Runtimes: Stateful Queues and Decoupled Execution

IADev
Interesse
dev.to

My AI agents' shared memory now sleeps on its own, and stopped losing conversations

I'm building Agent Brain Hub, an open-source memory that several AI agents share. It's modeled on the human brain, and like a brain it needs sleep: that's when conversations get consolidated into long-term memory, expired facts get forgotten, and the brain reflects on what it learned. Until this week, sleep only happened when someone clicked Run sleep cycle. While adding automatic sleep, I wrote a test for a long conversation and found a real problem. Working memory keeps only the last 40 turns. After 30 back-and-forth messages with nobody pressing the button, the first 10 questions were simply gone. They were never consolidated, so no agent could ever recall them. Trigger When Default Idle The customer has gone quiet, so the session is over 30 min Pressure Too many turns are waiting to be consolidated 24 turns Nightly Once a day, for customers active since last night 03:00 The core check is small: const trigger = turns >= cfg.maxPendingTurns ? 'pressure' : idleMinutes >= cfg.idleMinutes ? 'idle' : null; The 30-minute idle default isn't arbitrary: it's the same gap the brain already uses to decide that a new session has started. The pressure threshold stays below the 40-turn cap, so nothing is dropped. A few details I cared about: Manual and automatic sleeps share one queue, so two runs never touch memory at the same time. No surprise bills. On the first start, the server doesn't sleep every customer at once. With a paid LLM, that would mean a burst of summarization calls. You can watch it happen. Automatic runs show up live in the brain view, with a note saying why the brain fell asleep. Docker runs in UTC, so set TZ=Asia/Ho_Chi_Minh (or your zone), or "03:00" will be someone else's night. Settings live in the UI (Settings → Sleep cycle) or in BRAIN_SLEEP_* environment variables. There are 9 new tests, including one that reproduces the lost-turns bug. Try it with docker compose up. Feedback is very welcome, especially if you've solved memory consolidation different

IADev
Interesse
dev.to

Build a web-aware TypeScript agent with Mastra and Zenrows

This article was originally published on the Zenrows blog. In this tutorial, you'll build a Mastra agent with a custom Zenrows Fetch tool that reads protected and JavaScript-rendered pages, then add a workflow that fetches a list of URLs in parallel. You'll need Node.js 22.13 or later, an OpenAI or Anthropic API key, and a Zenrows API key. The finished agent compares live Walmart product listings and returns either Markdown to reason over or structured JSON with fields like price and rating. The complete code is on GitHub. You need Node.js 22.13 or later. You need an API key for one model provider. This tutorial uses OpenAI by default and shows the Anthropic alternative. Get an OpenAI key from your OpenAI developer dashboard or an Anthropic key from your Anthropic developer dashboard. You need a Zenrows API key to retrieve the full contents of web pages. Create one from your Zenrows dashboard. Mastra's built-in webFetchTool makes plain HTTP requests, doesn't run JavaScript, and returns raw HTML. That's enough for simple pages. On browser-rendered or protected pages, such as a product listing protected by Cloudflare, it breaks quietly. Cloudflare returns its challenge page with a normal HTTP status code, so the tool raises no error. The agent treats the challenge as the result and reports a missing or wrong price. The fix belongs in the transport layer, which controls HTTP requests, headers, proxies, and whether JavaScript runs. Zenrows Fetch with mode=auto handles DataDome, Akamai, and Cloudflare in a single call. Wrapping that call in Mastra's createTool keeps typed input and output schemas around the fetch. npm create mastra@latest The CLI scaffolds the project structure, config files, and a starter agent, and installs @mastra/core and its dependencies. Follow the prompts to name the project and pick your LLM provider. Then add Zod if the scaffold didn't include it. npm install zod Create a .env file in the project root with your keys. You only need the key for th

IADev
Interesse
dev.to

Base DeFi Vault Exploit Drains $6M via Whitelist Access Control Failure

The landscape of decentralized finance (DeFi) security is undergoing a subtle but dangerous evolution. Rather than targeting complex mathematical vulnerabilities in smart contract logic, threat actors are increasingly focusing on the administrative layers that govern them. This shift was starkly illustrated on October 4, 2026, when an unidentified DeFi vault operating on the Base network suffered a devastating exploit. By compromising the vault's whitelist access controls, an attacker successfully drained approximately $6 million in wrapped staked Ether (wstETH) in a matter of minutes. The targeted application was an unnamed vault running a substantial position on the Aave V3 Base market. Base, an Ethereum layer-2 network built on the OP Stack, has become a popular hub for decentralized lending. The specific vault held aBaswstETH, which are interest-bearing receipt tokens issued by Aave when a user supplies Lido’s wrapped staked Ether (wstETH) into the lending pool. The exploit unfolded with surgical precision over a remarkably short window. According to on-chain monitoring data, the vault was governed by a Safe multisignature wallet, a standard industry tool requiring multiple approvals for transaction execution. At exactly 08:52 UTC, the multisig executed a transaction that removed a newly deployed, previously unseen smart contract from the vault’s lending whitelist. Curiously, just one minute later at 08:53 UTC, the exact same contract was added right back onto the whitelist. Whether this erratic sequence was the result of a compromised signing device, a deceived signer, or a deliberate internal action remains officially unconfirmed. However, the consequence was immediate: the newly whitelisted contract instantly gained standing permission to interact with the vault as a trusted counterparty. Once authorized, the attacker moved quickly. Within roughly 19 minutes of the final whitelist modification, the malicious contract withdrew 1,783.067 aBaswstETH from the vau

Segurança
Interesse