今日已更新 244 条资讯 | 累计 27419 条内容
关于我们

今日精选

HOT

最新资讯

共 27419 篇
第 33/1371 页
AI 资讯 Dev.to

qm multiplayer AI agent tutorial: Cut Latency 20% with Node.js

This article was originally published on BuildZn . Everyone talks about multi-agent systems but few show you how to actually coordinate them without a ton of boilerplate and deadlocks. I spent weeks trying to get agents to talk, especially when building something like FarahGPT's multi-agent trading system, often hitting insane latency. Turns out, qm can drastically simplify this, and this qm multiplayer AI agent tutorial will show you how to cut task completion times by 20% using a specific Node.js workflow. Why Multi-Agent Systems Aren't Just Hype Anymore (and qm Helps) Single LLM calls hit a wall, fast. You get generic answers, struggle with complex, multi-step tasks, and prompt engineering becomes a full-time job. I've built 9-agent YouTube automation pipelines and an AI gold trading system that needed to analyze market data, news sentiment, and historical trends concurrently. Trying to jam all that into one prompt for a single agent? Forget about it. You need a collaborative AI agent architecture . That's where multi-agent systems shine. You break down complex problems into smaller, manageable tasks, assign them to specialized agents, and have them work together. Think of it like a dev team: one person focuses on backend, another on frontend, another on CI/CD. This is how you handle real-world complexity, and it's how I scaled FarahGPT to 5,100+ users. The challenge? Orchestration. How do these agents communicate? Who manages their state? How do you ensure they don't step on each other's toes or get stuck waiting for slow upstream tasks? This is exactly where qm , a lightweight agent harness, becomes a game-changer for building AI teams. It gives you the primitives to define agents, tasks, and workflows without drowning in custom event loops. The Core Concept: Task Delegation in qm Most qm examples show simple agent interactions. Agent A asks Agent B. Done. But what if Agent A needs to delegate a task that itself needs parallel sub-tasks, and then aggregate the

Umair Bilal 2026-08-01 14:25 6 原文
AI 资讯 Dev.to

JWT Validation: Verifying Tokens for Authentication and Authorization

JWT Validation: Verifying Tokens for Authentication and Authorization A practical guide to JWT validation — the process of checking a JSON Web Token's signature, claims, and structure to confirm a request is genuinely authenticated and authorized — covering signature verification, standard claim checks, key rotation, validation in ASP.NET Core, and the mistakes that most commonly lead to broken or bypassed validation. Table of Contents Introduction Anatomy of a JWT Signing Algorithms What "Validation" Actually Checks Signature Verification and Key Rotation Standard Claim Validation Validating JWTs in ASP.NET Core Custom Validation Logic Token Revocation: JWT's Fundamental Limitation Validating JWTs Across Services Common Vulnerabilities Debugging Validation Failures Quick Reference Table Conclusion Introduction A JWT arriving in an Authorization: Bearer <token> header is just a string until it's actually validated — and validation is doing considerably more work than it might first appear. It's not just "does this look like a JWT" or even just "is the signature valid" — proper validation confirms the token was issued by a trusted party, intended for this specific API, still within its valid time window, and hasn't been tampered with in any way. Get any one of these checks wrong or skip it, and you can end up with an API that accepts tokens it absolutely shouldn't. builder . Services . AddAuthentication ( JwtBearerDefaults . AuthenticationScheme ) . AddJwtBearer ( options => { options . Authority = "https://login.microsoftonline.com/{tenant-id}/v2.0" ; options . Audience = "api://my-api" ; }); Those two lines look simple, but they configure a genuinely thorough validation pipeline underneath — this guide covers exactly what that pipeline actually checks, why each check matters, and where things commonly go wrong when validation is configured incorrectly or bypassed under pressure. 1. Anatomy of a JWT Three parts, dot-separated eyJhbGciOiJSUzI 1 NiIsInR 5 cCI 6 IkpXVC

Rhuturaj Takle 2026-08-01 14:23 4 原文
AI 资讯 Dev.to

Fixing a Memory Leak in React by Cleaning Up useEffect

Project Overview The project is a React-based web application that fetches data from a REST API and displays it in a dynamic dashboard. Users can navigate between pages, search data, and interact with multiple components that rely on asynchronous API calls. While testing the application, I noticed that navigating away from a page during an active API request occasionally caused React warnings and unnecessary memory usage. This issue affected the application's stability and could lead to performance degradation over time. The problem was caused by an asynchronous operation continuing even after the component had been unmounted. For example, an API request initiated inside useEffect would still complete after the user navigated away, attempting to update the component's state. React would warn that a state update was attempted on an unmounted component. Before useEffect(() => { fetch("/api/users") .then((res) => res.json()) .then((data) => setUsers(data)); }, []); If the component unmounted before the request finished, the callback still attempted to update the state. After I solved the issue by using the AbortController API to cancel the request during cleanup. useEffect(() => { const controller = new AbortController(); fetch("/api/users", { signal: controller.signal, }) .then((res) => res.json()) .then((data) => setUsers(data)) .catch((err) => { if (err.name !== "AbortError") { console.error(err); } }); return () => controller.abort(); }, []); This ensures that pending requests are cancelled when the component unmounts, preventing unnecessary state updates and avoiding memory leaks. Code Prince3963 (Patel Prince) / Repositories · GitHub Prince3963 has 48 repositories available. Follow their code on GitHub. github.com My Improvements This fix focused on improving both performance and application reliability. What I improved Prevented memory leaks caused by unfinished asynchronous requests. Added proper cleanup logic inside useEffect. Eliminated React warnings about u

Prince Patel 2026-08-01 14:20 3 原文
AI 资讯 Dev.to

AI Agent 市场设计:让 Agent 像 App 一样被交易与编排

AI Agent 市场设计:让 Agent 像 App 一样被交易与编排 App Store 把「软件」变成了可被一键购买、安装、评分的商品,AI 时代对应的实体是「Agent」。一个 Agent = 一段可被复用的提示词 + 工具集 + 知识库 + 模型路由配置。本文讲清楚一个 Agent 市场需要哪些核心机制,以及 IHUI-AI 的实现路径。 一、Agent 市场的产品定义 什么是「可上架的 Agent」 不是所有对话 prompt 都能成为商品。一个可上架的 Agent 必须满足: 可独立运行 :用户购买后能立刻用,不需要再写代码。 可复用 :不同用户用同一个 Agent 都能得到稳定结果。 可定价 :有明确的使用边界(次数 / 时长 / 调用规模)。 可评估 :有客观的质量指标(成功率 / 满意度 / 失败率)。 Agent 定义格式 IHUI-AI 用一份 schema 描述可上架的 Agent: const MarketplaceAgentSchema = z . object ({ id : z . string (). uuid (), name : z . string (), description : " z.string(), " // 核心能力 systemPrompt : z . string (), tools : z . array ( z . string ()), // 引用工具/MCP server knowledgeBases : z . array ( z . string ()), // 绑定 RAG 知识库 modelRouting : z . object ({ default : z . string (), // 默认模型 fallback : z . string (). optional (), // 降级模型 }), // 定价 pricing : z . object ({ model : z . enum ([ " free " , " subscription " , " per_call " , " revenue_share " ]), price : z . number (), currency : z . string (). default ( " CNY " ), trialQuota : z . number (). default ( 0 ), }), // 评估 metrics : z . object ({ successRate : z . number (), avgLatencyMs : z . number (), rating : z . number (). min ( 0 ). max ( 5 ), usageCount : z . number (), }), }); 二、四种定价模型 模型 适用 优点 缺点 免费(Free) 引流、品牌 Agent 易扩散 无直接收入 订阅(Subscription) 高频工具型 Agent 收入稳定 流失需运营 按调用计费(Per Call) 低频高价值 Agent 与成本对齐 用户预算焦虑 分成(Revenue Share) 内容生成型 Agent 创作者激励 结算复杂 IHUI-AI 默认采用 订阅 + 按调用混合 :基础功能订阅包月,超出额度按调用计费,创作者拿 70% 分成。 三、Agent 质量评估:四维评分 简单的「5 星好评」不够,因为容易被刷分。IHUI 用四维加权: 任务成功率(40%) :Agent 完成用户原始任务的比率,由 LLM-as-Judge 自动评估。 用户评分(25%) :真实用户打分,过滤异常分布(全是 5 星或 1 星)。 响应延迟(15%) :首 token 时延 + 总时长,归一化到 [0,1]。 稳定性(20%) :错误率 + 重试率,错误越少分越高。 def agent_score ( metrics ) -> float : return ( 0.40 * min ( metrics . success_rate , 1.0 ) + 0.25 * metrics . user_rating / 5 + 0.15 * ( 1 - min ( metrics . p95_latency / 30_000 , 1 )) + 0.20 * ( 1 - min ( metrics . error_rate / 0.1 , 1 )) ) 这个分数实时更新,作为市场搜索排序的依据。 四、Agent 编排:从单个 Agent 到 Agent 工作流 单个 Agent 的能力有上限。Agent 市场的真正价值在于「让用户像搭积木一样编排多个 Agent」。

李春川 2026-08-01 14:16 1 原文
AI 资讯 Dev.to

The 4-part brief that keeps coding agents from drifting

Coding agents usually do not drift because they are incapable. They drift because the task leaves too much room for interpretation. A request like “clean up authentication” sounds clear to a human who already knows the codebase. To an agent, it can mean anything from renaming one helper to replacing the entire authentication stack. The fix is not a longer prompt. It is a brief with four explicit parts : Outcome Context Guardrails Definition of Done Below is the exact structure I use. 1. State the outcome as an observable change Describe what should be different for the user or system when the work is complete. Weak: Fix the login bug. Better: When a user submits an expired magic link, show the existing “Link expired” message and offer a button that requests a new link without leaving the page. The better version gives the agent a destination. It does not prescribe the implementation, but it makes success testable. 2. Give only the context that changes the decision Context is useful when it removes ambiguity. It becomes noise when it is a tour of the whole repository. Useful context often includes: The relevant entry point or route The existing component or service that should be reused A similar implementation elsewhere in the codebase The command used to run the relevant tests A known constraint, such as backwards compatibility Example: The page is implemented in app/auth/verify/page.tsx . Reuse requestMagicLink() from lib/auth/client.ts . The existing error-message styles live in components/auth/AuthNotice.tsx . That is enough to start investigating without pretending we already know the final patch. 3. Add guardrails that define the change boundary Guardrails prevent a small task from becoming an accidental rewrite. A useful set might be: Do not change the public API. Do not add dependencies. Keep the current visual design. Do not edit generated files. Limit changes to the authentication flow and its tests. If a database migration appears necessary, stop and expl

AgentBrief Studio 2026-08-01 14:14 3 原文
AI 资讯 Dev.to

How to structure a Chrome Extension with Manifest V3 (the right way)

If you've tried building a Chrome extension recently, you've probably hit Manifest V3 and spent an hour just figuring out why your background page stopped working. MV3 replaced background pages with service workers, changed how content scripts communicate, and made permissions stricter. The official docs are... not great. So here's the structure that actually works. The folder structure chrome-extension/ ├── manifest.json ├── popup/ │ ├── popup.html │ ├── popup.css │ └── popup.js ├── options/ │ ├── options.html │ └── options.js ├── content/ │ └── content.js ├── background/ │ └── service-worker.js ├── utils/ │ └── storage.js └── icons/ The manifest.json (MV3) The biggest MV3 gotcha: background scripts are now service workers. { "manifest_version": 3, "name": "Your Extension", "version": "1.0.0", "permissions": ["storage", "activeTab", "scripting"], "action": { "default_popup": "popup/popup.html" }, "background": { "service_worker": "background/service-worker.js" }, "content_scripts": [ { "matches": [""], "js": ["content/content.js"] } ] } Communicating between popup and content script This trips up almost everyone. The popup can't directly access the page DOM — it has to message the content script. // popup.js const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); await chrome.tabs.sendMessage(tab.id, { type: 'RUN_ACTION' }); // content.js chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { if (message.type === 'RUN_ACTION') { // do something on the page sendResponse({ success: true }); } return true; // keeps the channel open for async response }); The return true at the end is critical — without it, async responses silently fail. Storage that syncs across devices Use chrome.storage.sync instead of localStorage. Here's a utility wrapper that makes it clean to use anywhere: const Storage = { async get(key) { return new Promise((resolve) => { chrome.storage.sync.get([key], (result) => resolve(result[key])); }); }, async set

Aakanksha 2026-08-01 14:14 3 原文
AI 资讯 Reddit r/artificial

Any apps or websites that allow for turn based voice chat?

Any apps or websites that allow for turn based voice chat? I really missed the old standard voice mode on ChatGPT. It basically just read aloud the text models response. So it could allow for long responses unlike these new gen voice models that can only speak 1 paragraph max. I was wondering if there are any apps or websites that use turn based voice chat like the old standard voice mode on ChatGPT. So I would say my thing, then it would be the ai turn to speak and i couldn’t interrupt it till its finished. My current problem is that the new standard voice mode on ChatGPT can be interrupted. So it’s hears its own voice and keeps stopping. So I’m looking for alternative apps or websites that have this old functionality submitted by /u/obammala [link] [留言]

/u/obammala 2026-08-01 12:59 0 原文
开发者 InfoQ

AWS Introduces Free Sandbox Environments for Workshops

AWS Builder Center now offers free, time-limited sandbox environments for workshops, so developers no longer need to use their own AWS account and credit card or worry about unexpected charges. This has been a long-standing request from the community and removes one of the biggest friction points for practitioners learning new AWS technologies. By Renato Losio

Renato Losio 2026-08-01 12:49 4 原文
AI 资讯 Dev.to

Quality Isn't Accidental — Maker/Checker Separation and Automated Validation

The Core Argument : AI agent reliability isn't achieved by "making the agent smarter" — it's achieved by the simple engineering principle of separating validation from generation . Quality isn't accidental. It's designed. What You'll Learn : Maker/Checker separation, 6 termination conditions, and an automated feedback loop — all with runnable code. 0. Prerequisites Python ≥ 3.10 OpenAI API Key (or compatible interface) pip install openai>=1.0.0 (Optional) pip install anthropic>=0.30.0 if using Claude as Checker 1. The Pain: Why "Agent Checks Itself" Is a Trap 1.1 The Copying of Cognitive Bias A team built a data-analysis agent. It pulled sales data from a database and generated business reports. The team added a "self-review" step: after generating, the agent told itself "please check if the data you just output is accurate." Result? The agent always replied "data is accurate." Even when the team deliberately injected obvious errors (e.g., monthly sales of -50M RMB), the agent confidently said everything was fine. This isn't the model being "disobedient." It's a more fundamental issue: when the generator and checker are the same entity, the check is just a restatement of the generation process — not real validation. The checker carries the exact same cognitive bias, knowledge boundaries, and reasoning path as the generator. 1.2 The Amplifier Effect of Confirmation Bias Self-checking also triggers a subtler problem: confirmation bias amplification. The model builds a "belief state" during generation; when re-examining, it tends to confirm rather than overturn. Experiment data (from Anthropic research): Same model does "generate → self-review": ~12% error-correction rate A separate model instance reviews: ~37% error-correction rate A different model family reviews: ~52% error-correction rate 1.3 The Value of Independence First principle of quality assurance: the checker must be independent of the generator. In agent architecture, the engineering expression of this is

weiwuji 2026-08-01 11:42 7 原文
AI 资讯 Dev.to

How Much Memory Does Your Agent Need? — A Practical Memory Store Selection Guide

The Pain : You search GitHub and find everyone using different memory stores — ChromaDB, PostgreSQL, plain Markdown files, "SQLite is good enough for a decade." Which is right? The Answer : All of them. And none of them. Choosing without understanding your scenario is like buying a car without checking the road. 1. The Counter-Intuitive Question: Does Your Agent Actually Need "Memory"? When I was building a university admissions data scraper (91 universities), I made the classic mistake: I equipped the agent with a full ChromaDB + vector retrieval stack, spent three days tuning it, and then discovered — 95% of the agent's time was just reading "which page did I get to last time." A boolean would have sufficed. I built a vector database capable of semantic search. An engineer friend at ByteDance told me their internal agent platform found, after six months, that vector retrieval accounted for only 3.7% of all Memory Store requests. The remaining 96.3%? Key-value lookups, state reads/writes, error dedup. The vector search you spent two weeks integrating might serve less than 4% of your queries. So before discussing "which storage," we must answer a more fundamental question: what does your agent actually need to remember? I categorize memory into four types: Memory Type Typical Content Size Access Frequency Consistency Session state "Processing university 37/91" ~100 bytes Every call Strong Domain knowledge "A-University rate limit is 10 req/s" ~1KB On demand Eventual Error history "B-University returns 403 because UA blocked" ~MB Before new task Append-only Semantic memory "Map 'that red button' to settings page" varies Occasional Eventual See the pattern? If your agent mainly does multi-step automation (data scraping, report generation, CI/CD pipelines), the first three types are the real needs — and none of them require a vector database. Core thesis: memory selection is about finding the layer that is "just enough." One layer too many is waste; one layer too few i

weiwuji 2026-08-01 11:41 7 原文