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

标签:#rag

找到 104 篇相关文章

AI 资讯

How AI Applications Answer From Your Data, Not Their Training

Why retrieval-augmented generation has become the foundational pattern for building useful AI — and how it actually works. The Problem With Relying on LLMs Alone Large language models are impressive. They can write, reason, summarize, and explain across an enormous range of topics. But they have a hard boundary: their knowledge stops at their training cutoff. Anything that happened after that date, anything specific to your company, your codebase, or your documents — the model simply doesn't know it. The naive solution is to paste your data directly into the prompt. For short content, this works. But prompts have limits. A model can only process so much text at once, and even within that limit, quality degrades when you stuff too much context in. The model loses track of things buried in the middle, confuses similar passages, and starts guessing when it should be reading. RAG — Retrieval-Augmented Generation — solves this properly. Instead of sending everything to the model and hoping for the best, you send only what's actually relevant to the question being asked. The Core Idea The analogy that makes RAG click immediately: imagine a student sitting an open-book exam. They don't memorize the entire textbook. When they see a question, they flip to the right chapter, read the relevant section, and write their answer from what they just read. They're not guessing. They're grounding their answer in the source material. RAG does exactly this. When a user asks a question, the system finds the most relevant pieces of information from your data, hands those pieces to the LLM as context, and the model answers from that context alone. The result is accurate, grounded, and verifiable — you can point to exactly which source the answer came from. The process runs in two phases: ingestion, which prepares your data in advance, and retrieval, which happens at query time. Phase One: Ingestion Ingestion is the preparation step. Before any user asks anything, you process your data and

2026-06-06 原文 →
AI 资讯

What Is a SERP API and Why Do SEO and AI Teams Need One?

Search results look simple from the outside. You type a keyword into Google, Bing, or another search engine, and you get a page of links, snippets, ads, maps, news, images, videos, and sometimes AI-generated answers. But if you have ever tried to collect search results at scale, you know it gets messy quickly. A result page is not just a list of links. It changes by country, language, device, location, query intent, and search engine. The same keyword can show different rankings in New York, London, Singapore, or Berlin. A page may include organic results, paid ads, local packs, shopping results, People Also Ask, news results, images, videos, or other SERP features. For humans, that is just a search page. For SEO teams, AI teams, data teams, and developers, it is a data source. That is where a SERP API becomes useful. What is a SERP API? SERP stands for Search Engine Results Page . A SERP API is an API that lets you collect search engine results in a structured format, usually JSON and sometimes HTML. Instead of manually searching a keyword or building a scraper to parse search result pages, you send a request to a SERP API with parameters such as: keyword search engine country language location device type output format The API then returns structured search data. A simplified response might look like this: { "query" : "best project management software" , "organic_results" : [ { "position" : 1 , "title" : "Best Project Management Software Tools" , "link" : "https://example.com" , "snippet" : "Compare features, pricing, and reviews..." } ] } This is much easier to work with than raw HTML. You can store it in a database, send it to a dashboard, compare rankings over time, feed it into an AI workflow, or generate automated reports. Why not just scrape search results yourself? You can build your own scraper. For a small test, that may be enough. You can send a request, parse the HTML, extract titles and links, and save the data. The problem starts when the workflow bec

2026-06-06 原文 →
AI 资讯

Dropbox Nova for AI Coding Agents, OpenAI's Codex Sandbox, & Puppeteer MCP Server

Dropbox Nova for AI Coding Agents, OpenAI's Codex Sandbox, & Puppeteer MCP Server Today's Highlights This week, we dive into Dropbox's Nova platform for scaling AI coding agents and OpenAI's secure sandbox architecture for Codex, highlighting advanced production deployments. We also examine practical solutions for safer browser automation for AI agents, detailing a custom Puppeteer MCP server. Dropbox Introduces Nova, an Internal Platform for Running AI Coding Agents at Scale (InfoQ) Source: https://www.infoq.com/news/2026/06/dropbox-nova-ai-coding-agents/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global Dropbox has unveiled Nova, an internal platform meticulously engineered to orchestrate and scale AI coding agents. This platform tackles the complex challenges of managing autonomous AI entities performing tasks like code generation, bug fixing, and refactoring across a large codebase. Nova's architecture focuses on reliability, efficiency, and safety, providing a robust environment for thousands of agents to operate concurrently without overwhelming system resources or introducing instability. The platform acts as a critical layer between AI models and the vast codebase, enabling agents to interpret development tasks, interact with repositories, and propose changes in a controlled manner. The significance of Nova lies in its ability to industrialize the use of AI in software development workflows. By abstracting away the operational complexities of agent deployment and execution, Dropbox empowers its engineering teams to leverage AI as a force multiplier, accelerating development cycles and improving code quality. Nova represents a practical, large-scale implementation of AI agent orchestration, demonstrating how companies are moving beyond experimental AI tools to integrate them deeply into core business processes. This showcases a production-grade pattern for applied AI, particularly relevant for "code generation" and "workflow automati

2026-06-06 原文 →
AI 资讯

The Context Compression Pattern

Pattern Defined Precise Definition: Context Compression is an inference pattern that utilizes a specialized "selector" model or a ranker to distill large volumes of retrieved data into its most salient semantic components, removing redundant or irrelevant tokens before the final inference pass. Problem Being Solved We are currently fighting the "Lost in the Middle" phenomenon. Even with massive token windows, LLM performance degrades significantly when relevant information is buried deep within a context block; more data often leads to less accuracy. For a Director of Engineering, this is a direct threat to the Sovereign Vault's integrity. Every irrelevant token passed to the model is a potential point of failure for privacy airlocks and data governance. As established with the Sovereign Redactor , minimizing the noise isn't just about saving money—it is about shrinking the surface area for hallucinations and privacy leaks. Use Case Consider an Archival Intelligence system processing 1880s shipping ledgers. A single query about "cargo weights in 1884" might pull 20 pages of scanned text. Most of those pages contain sailor names and weather reports that have no bearing on the weight data. Without compression, the model has to "read" the entire ledger, leading to high costs and potential confusion. With the Context Compression pattern, a smaller, faster ranker identifies the specific sentences regarding "tonnage" and "cargo," passing only those 200 relevant words to the high-reasoning model. The Forensic Auditor gets a precise answer in half the time. Solution The pattern typically follows a three-step pipeline: Retrieve: Fetch the top documents using standard RAG. Compress: Use a technique like LongLLMLingua (a token-pruning method developed by Microsoft Research) or a Cross-Encoder to rank and prune tokens. Synthesize: Pass the condensed, high-signal prompt to the final model. flowchart LR A([User Query]) --> B[RAG Retrieval\nTop N Documents] B --> C[Compression Lay

2026-06-05 原文 →
AI 资讯

LLM Cost Attribution with OTel, Next.js for AI Agents, LLM Security Testing

LLM Cost Attribution with OTel, Next.js for AI Agents, LLM Security Testing Today's Highlights This week, we delve into practical strategies for managing LLM costs in production using OpenTelemetry and explore Next.js 16.2's new tooling for building AI agent frontends. We also examine an experiment on LLMs' ability to exploit application vulnerabilities, emphasizing security in applied AI. Per-project LLM cost attribution with OTel spans: the wiring (Dev.to Top) Source: https://dev.to/jasmine_park_dev/per-project-llm-cost-attribution-with-otel-spans-the-wiring-3897 This article details a practical approach to attributing Large Language Model (LLM) costs to specific teams or projects within an organization. Facing a common problem of LLM bills appearing as a single line item, the author describes how to implement granular cost tracking using OpenTelemetry (OTel) spans. The core idea involves instrumenting the LLM gateway to tag every request span with relevant metadata like team.id and llm.model_name . This allows for detailed reporting and chargebacks, enabling organizations to understand and manage their LLM expenditure effectively. The implementation focuses on "the wiring" behind this system, leveraging OTel for observability. By attaching custom attributes to spans, teams can aggregate usage data by project, department, or even specific application features. This moves beyond opaque cloud invoices to actionable insights, a crucial step for companies scaling their AI adoption and seeking to optimize resource allocation and financial accountability for generative AI services. The article provides a blueprint for integrating this mechanism into existing LLM infrastructure. Comment: Setting up OTel spans for LLM cost attribution is a game-changer for production environments, finally giving us visibility into who's spending what on which models. This technique is essential for scaling LLM applications sustainably. Next.js 16.2: Deeper Tooling for AI Agents (InfoQ) So

2026-06-05 原文 →
AI 资讯

Gemma 4 12B Multimodal, AI Copilot Selection, & AI-Optimized Documentation Strategies

Gemma 4 12B Multimodal, AI Copilot Selection, & AI-Optimized Documentation Strategies Today's Highlights Today's top stories delve into a new foundational multimodal AI model, strategic selection of AI copilots for productivity, and practical techniques for creating documentation suitable for both human readers and AI assistants. These insights are crucial for developers building and deploying advanced AI solutions in real-world workflows. Gemma 4 12B: A unified, encoder-free multimodal model (Hacker News) Source: https://blog.google/innovation-and-ai/technology/developers-tools/introducing-gemma-4-12b/ Google has announced Gemma 4 12B, marking a significant step forward in multimodal AI. This model distinguishes itself with a "unified, encoder-free" architecture, simplifying the process of handling diverse data types such as text and images without the need for separate encoding layers. This architectural innovation promises more efficient training, reduced inference costs, and improved coherence in understanding and generating content across different modalities. For developers, Gemma 4 12B provides a robust and flexible foundation for building sophisticated AI applications. It enables the creation of intelligent systems that can process and respond to complex queries involving various input formats, from intelligent search and content generation to advanced human-computer interaction. This streamlined approach to multimodal processing is critical for developing next-generation AI tools and frameworks. Comment: An encoder-free, unified multimodal architecture for Gemma 4 12B is a big deal for reducing complexity and improving cross-modal understanding. This model could significantly simplify building AI applications that need to process and generate content across text and images efficiently. Presentation: Choosing Your AI Copilot: Maximizing Developer Productivity (InfoQ) Source: https://www.infoq.com/presentations/choosing-ai-copilot/?utm_campaign=infoq_content&

2026-06-04 原文 →
AI 资讯

Hybrid RAG, No-Code AI Agent Memory, & Google Workspace CLI for Agents

Hybrid RAG, No-Code AI Agent Memory, & Google Workspace CLI for Agents Today's Highlights Today's top stories delve into advanced RAG techniques, focusing on hybrid retrieval strategies to overcome limitations of vector-only search, and explore practical solutions for equipping AI agents with long-term memory. Additionally, we highlight a new unified CLI that empowers AI agents to automate tasks across Google Workspace, streamlining workflow automation. Why Vector Search Alone Isn't Enough: Hybrid Retrieval for RAG (InfoQ) Source: https://www.infoq.com/articles/vector-search-hybrid-retrieval-rag/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global This article addresses a critical limitation in current RAG (Retrieval-Augmented Generation) frameworks: the over-reliance on pure vector search. While semantic vector search excels at understanding conceptual similarity, it often struggles with exact keyword matching or retrieving information from documents that lack strong semantic context but contain vital terms. The piece advocates for hybrid retrieval, a strategy that combines semantic (vector-based) search with lexical (keyword-based, e.g., BM25) search. This combination significantly enhances the recall and precision of retrieved documents, leading to more accurate and contextually relevant responses from large language models. For practitioners, understanding and implementing hybrid retrieval is essential for building robust, production-grade RAG systems capable of handling diverse queries and document types, thereby improving overall document processing and search augmentation performance. Comment: Anyone building serious RAG apps knows vector search has blind spots. Hybrid retrieval is a non-negotiable step for production, ensuring critical keywords aren't overlooked and improving overall response quality. Give your AI agent long-term memory with MCP (no code) (Dev.to Top) Source: https://dev.to/lrdeoliveira/give-your-ai-agent-long-term-me

2026-06-03 原文 →
AI 资讯

멀티 에이전트(Multi-agent) AI 시스템 가이드 2026 — 싱글 에이전트와 차이·도입 사례·외주 비용

멀티 에이전트(Multi-agent) AI 시스템은 여러 AI 에이전트가 역할을 분담하고 서로 통신하면서 복잡한 업무를 자율적으로 처리하는 구조다. 한 에이전트가 처음부터 끝까지 처리하는 싱글 에이전트와 달리, 검색·분석·실행·검증을 각각 다른 에이전트가 병렬로 맡고 그 결과를 조율(orchestration)한다. 2026년 한국 기업 AI 도입은 단일 챗봇 단계를 지나, 다단계 의사결정과 도메인 특화 작업을 자동화하는 멀티 에이전트 단계로 이동 중이다. 이 글은 멀티 에이전트와 싱글 에이전트의 구조적 차이, 도입 비용·기간·실패 위험, 국내 도입 사례, 외주 발주 시 업체 선택 기준까지 발주 담당자가 의사결정에 바로 쓸 수 있는 비교표·체크리스트를 제공한다. 멀티 에이전트와 싱글 에이전트, 무엇이 다른가? 싱글 에이전트는 하나의 LLM 인스턴스가 도구(tool)를 직접 호출하면서 모든 단계를 처리한다. 작업 흐름이 선형적이고 컨텍스트가 한곳에 모이므로 구현이 단순하다. 반면 멀티 에이전트는 작업을 여러 하위 작업으로 쪼개고, 각 에이전트가 자기 역할(role)·시스템 프롬프트·도구 집합을 따로 가진 채 협업한다. 가장 흔한 패턴 세 가지를 정리하면 다음과 같다. Supervisor 패턴 : 상위 supervisor 에이전트가 작업을 받아 worker 에이전트들에게 분배하고 결과를 통합한다. 의사결정 라인이 명확해 디버깅이 쉽다. Peer 패턴 : 동등한 에이전트들이 메시지 큐로 정보를 주고받으며 합의(consensus)를 이룬다. 창의적 결과가 필요한 리서치·기획에 적합하다. Hierarchical 패턴 : supervisor 아래 sub-team을 두고, sub-team 안에서 다시 supervisor-worker 구조를 반복한다. 대규모 RPA·복합 업무 자동화에 쓰인다. 구분 싱글 에이전트 멀티 에이전트 적합한 작업 1~3단계 선형 작업 5단계 이상, 분기·검증 필요 컨텍스트 관리 단일 컨텍스트 윈도우 에이전트별 분리 + 공유 메모리 토큰 비용 낮음 1.8~3배 (병렬·검증 오버헤드) 구현 난이도 낮음 높음 (조율·실패 처리) 정확도 단순 작업에 충분 복잡 작업에서 10~25%p 향상 외주 비용(국내) 800만~3,000만 원 3,000만~1.2억 원 구축 기간 4~8주 10~16주 Anthropic의 멀티 에이전트 리서치 시스템 사례 에서는 단일 Claude 에이전트 대비 멀티 에이전트 구조가 리서치 품질 평가에서 약 90% 더 높은 점수를 받았다. 다만 토큰 사용량은 약 15배로 늘어, 모든 작업에 멀티 에이전트가 정답은 아니라는 점도 같은 글에서 강조한다. 언제 멀티 에이전트가 필요한가? — 도입 판단 트리 발주 담당자가 자주 묻는 질문은 "우리 업무에 멀티 에이전트가 정말 필요한가"이다. 다음 네 가지 조건 중 두 개 이상에 해당하면 멀티 에이전트가 ROI를 만든다. 작업이 5단계 이상이고, 각 단계가 다른 전문성을 요구한다 — 예: 시장 리서치 → 경쟁사 분석 → 보고서 작성 → 사실 검증. 결과의 신뢰도가 비즈니스 결정에 직결된다 — 검증 에이전트(critic)를 두면 환각 비율이 의미 있게 떨어진다. 작업 분기(branching)가 데이터에 따라 동적으로 결정된다 — 단순 if/else로는 표현 어려운 휴리스틱 분기. 여러 외부 시스템(SaaS·DB·내부 API)을 동시에 다뤄야 한다 — 도구 권한을 에이전트별로 격리하면 보안 관리도 쉬워진다. 반대로 다음에 해당하면 멀티 에이전트는 과잉이다. 싱글 에이전트로 충분하다. 단순 FAQ 챗봇, 분류·태깅 같은 단발성 작업. 작업당 비용이 100원 미만이어야 하는 대규모 트래픽 환경. 인간 검수자(HITL)가 매번 결과를 확인하는 워크플로우 — 멀티 에이전트의 자율성이 오히려 검수 부담을 늘린다. 나무숲에서도 초기에는 모든 자동화를 싱글 에이전트로 구축했다가, 검증·분기·외부 API 호출이 동시에 일어나는 마케팅 자동화 파이프라인부터 멀티 에이전트로 재설계한 경험이 있다. 무조건 멀티 에이전트가 좋은 게 아니라, 위 네 조건을 충족한 영역만 옮긴 것이

2026-06-02 原文 →
AI 资讯

Agent Orchestration & Workflow Automation: Dynamic Workflows, Robust Agent Patterns, and On-Commit AI Code Review

Agent Orchestration & Workflow Automation: Dynamic Workflows, Robust Agent Patterns, and On-Commit AI Code Review Today's Highlights This week's highlights focus on advancements in AI agent coordination with Claude Code's new Dynamic Workflows, a pragmatic 6-file system for reliable agent state management, and the release of peektea v2 for on-commit AI code review. Claude Code Adds Dynamic Workflows for Parallel Agent Coordination (InfoQ) Source: https://www.infoq.com/news/2026/06/dynamic-workflows-claude-code/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global Anthropic has introduced Dynamic Workflows, a significant enhancement to Claude Code, designed to improve the coordination and efficiency of AI agents in complex tasks. This new capability enables developers to orchestrate multiple AI agents in parallel, allowing them to collaborate on different parts of a problem simultaneously. Unlike traditional sequential processing, Dynamic Workflows facilitate a more natural, concurrent approach, where agents can dynamically assign sub-tasks, share intermediate results, and adapt their strategies based on real-time progress. This is particularly beneficial for large-scale code generation, complex project management, and multi-stage data analysis where distinct competencies are required from different specialized agents. The core benefit of Dynamic Workflows lies in its ability to manage dependencies and synchronize agent activities, leading to faster execution and more robust outcomes. For instance, in a coding scenario, one agent might focus on generating unit tests while another refactors existing code, both operating in parallel and integrating their work seamlessly. This dynamic coordination mechanism moves beyond simple sequential chaining, offering a powerful paradigm for building sophisticated, multi-agent systems that mirror human team collaboration. Developers can leverage this to create more resilient and adaptive AI-driven workflows,

2026-06-02 原文 →
AI 资讯

LangGraph Production, RAG Memory Challenges, and AI Agent Patterns

LangGraph Production, RAG Memory Challenges, and AI Agent Patterns Today's Highlights Today's highlights dive into practical LangGraph pipeline construction for agentic AI workflows, reveal critical insights from real-world RAG retrieval failures, and unveil 29 open-source design patterns for building robust AI agents. Building Your First LangGraph Pipeline: A Decision-Maker's Guide (Dev.to Top) Source: https://dev.to/labyrinthanalytics/building-your-first-langgraph-pipeline-a-decision-makers-guide-4e25 This article serves as a comprehensive guide for developers looking to implement their first LangGraph pipeline for agentic AI workflows. LangGraph is highlighted as a leading framework for building complex, stateful multi-actor applications, particularly valued for its production readiness and active maintenance. The guide aims to demystify the initial setup and design choices, providing a structured approach for integrating LangGraph into real-world applications. It addresses the common challenges and decision points faced by teams adopting new AI orchestration frameworks, ensuring a smoother development process. The piece emphasizes the practical considerations for building robust and scalable AI agents. It likely delves into architectural patterns, state management within agentic systems, and how to effectively sequence different AI models or tools into a cohesive workflow. For those focused on production deployment, the guide would cover best practices for reliability, testing, and potential optimizations when scaling AI agents. By offering a "decision-maker's guide," it goes beyond mere syntax, encouraging readers to think critically about the implications of their design choices for long-term maintainability and performance in applied AI contexts. Comment: LangGraph is a critical tool for serious agentic AI development; this guide to building pipelines and making early design decisions is exactly what many developers need to get started right. I Published an A

2026-06-01 原文 →
AI 资讯

0% vs 50%: Making a RAG Agent Refuse to Hallucinate

0 % vs 50 %: making a RAG agent refuse to hallucinate 2026-05-31 · LLM / RAG A retrieval-augmented agent is only as trustworthy as its behaviour on questions whose answer isn't in the corpus . The failure mode is quiet: instead of saying "I don't know," the model invents a confident, well-formed, wrong answer. This post shows a single guardrail that takes that from common to never — and, crucially, measures it. Reference architecture: nim-agent-blueprint — agentic RAG on the NVIDIA NIM stack with a built-in eval harness. The ablation The agent loop is plan → retrieve → generate → validate . The interesting variable is the generation prompt's contract with the retrieved context: Configuration Out-of-corpus hallucination rate Generate freely from context ~50 % Guarded prompt (answer only from context; otherwise abstain) 0 % Same model, same retriever, same questions. The only change is a prompt that makes "I can't answer that from the provided sources" a first-class, rewarded output — plus a validate step that checks the answer is grounded in retrieved spans before returning it. On in-corpus questions, retrieval recall@3 stayed at 94–100 % , so the guardrail buys safety without costing coverage. Why "just prompt better" isn't the lesson The lesson isn't the prompt — it's that the difference between 50 % and 0 % is invisible without an eval harness . A demo that only asks in-corpus questions looks perfect in both configurations. You only see the 50 % when you deliberately ask things the corpus can't answer and score groundedness . So the blueprint ships with: retrieval hit-rate (is the answer even retrievable?), answer groundedness via LLM-as-judge (is the answer supported by what was retrieved?), latency , and OpenTelemetry traces per agent step. That's the difference between "it works on my five questions" and "here is the number a partner can hold me to." Takeaway For enterprise RAG, abstention is a feature, not a failure. Make "I don't know" a rewarded output, vali

2026-05-31 原文 →
AI 资讯

Progressive Distillation

Now that almost everyone has thought about or is actively integrating AI workflows into their projects, some might ask is this all worth the cost? Many think the current economics of the AI space don't scale and that there will be upward price movement. Others still might not be comfortable with sending their data to remote services for processing. Then there is the crowd that wants to deploy models in small spaces with limited compute. Are there ways we can deploy small models locally and run at a lower cost? Yes with Knowledge Distillation . Knowledge distillation can get a bad rap due to it's questionable use in training some Large Language Models (LLMs). But it's a perfectly valid way to transfer performance from a larger model to a smaller one. Especially when both models are yours and/or open. This article will explore progressive distillation which is a technique to incrementally transfer knowledge from a series of larger teacher models into a smaller student. Install dependencies Install txtai and all dependencies. pip install txtai [ pipeline - train ] datasets Setup the Training Pipeline The first step we need to do is setup up the training pipeline. We'll use the Hugging Face Training framework to build a series of models. The following code establishes a train method, test method and loads the classification training data. from datasets import load_dataset from transformers import AutoModelForSequenceClassification , AutoTokenizer from txtai.pipeline import HFTrainer , Labels def train ( teacher , student , distillation , ** kwargs ): trainer = HFTrainer () model = AutoModelForSequenceClassification . from_pretrained ( student , trust_remote_code = True ) tokenizer = AutoTokenizer . from_pretrained ( student , trust_remote_code = True ) return trainer ( ( model , tokenizer ), ds [ " train " ], columns = ( " sentence " , " label " ), maxlength = maxlength , teacher = teacher , distillation = distillation , ** kwargs ) def test ( model ): labels = Labels (

2026-05-31 原文 →
AI 资讯

How RAGScope Knows Which Chunks Your LLM Actually Used

How RAGScope Knows Which Chunks Your LLM Actually Used Your retriever fetched 10 chunks. Your LLM only used 3. RAGScope shows a precision score of 30 out of 100. The question every new user asks: how does it know? There is no OpenTelemetry attribute that says "this chunk was in the context window." RAGScope infers it — and the way it does this is the most consequential piece of engineering in the whole tool. There Is No "In Context" Attribute in OTel The OpenTelemetry semantic conventions for generative AI ( gen_ai.* ) define attributes for model, input/output tokens, and retrieved documents. They do not define anything like gen_ai.chunk.reached_llm or gen_ai.retrieval.used_document_ids . When your RETRIEVER span fires, you get a list of documents. When your LLM span fires, you get a prompt and a completion. The two spans are connected by a parent-child trace relationship — but there is no attribute that maps which retrieved documents appear in which prompt. This gap matters. A reranker might drop 7 of your 10 chunks. Your application code might apply a token budget and truncate 4 more. From the trace alone, you cannot tell. RAGScope needs this information to compute the precision sub-score — the highest-weighted metric at 40% of the overall score. Getting it wrong would make precision meaningless. The Substring Match — How assembleContext Works RAGScope's answer is in src/enrichment/pipeline.ts , in a function called assembleContext : function assembleContext ( chunks : RagChunk [], llmSpans : ParsedSpan []): RagChunk [] { const llmPrompts = llmSpans . map (( s ) => s . prompt ). filter (( p ): p is string => !! p ); if ( llmPrompts . length === 0 ) return chunks ; let position = 0 ; return chunks . map (( chunk ) => { if ( ! chunk . content ) return chunk ; const inContext = llmPrompts . some (( p ) => p . includes ( chunk . content ! )); if ( inContext ) { return { ... chunk , inContext : true , contextPosition : position ++ }; } return { ... chunk , inContext :

2026-05-31 原文 →
AI 资讯

Bringing MongoDB Atlas and Voyage AI to Dify: Build RAG Workflows and Data Agents Without Heavy Glue Code

AI applications are moving quickly from simple chatbots to systems that can search, reason, recommend, summarize, and act on live business data. For developers, that usually means wiring together databases, embedding models, vector search, rerankers, orchestration logic, and application code. For no-code AI builders, it often means waiting for those integrations to exist before an idea can become a working prototype. The MongoDB extensions for Dify help close that gap. With the new MongoDB Atlas and Voyage AI extensions, Dify builders can visually compose AI workflows and agents that connect directly to MongoDB data, perform semantic retrieval with Atlas Vector Search, improve result quality with Voyage AI embeddings and reranking, and optionally interact with operational documents through controlled database tools. The result is a practical path from idea to working AI application: less custom orchestration code, more reusable building blocks, and a smoother experience for both developers and no-code builders. Why Dify and MongoDB Belong Together Dify provides a visual environment for building AI apps, workflows, and agents. It makes it easy to connect user input, model calls, tools, prompts, and outputs into a working application. MongoDB Atlas provides the data foundation: flexible documents, operational queries, aggregation, full-text search, and vector search in one platform. Together, they create a powerful pattern: Dify orchestrates the AI experience — workflows, agents, prompts, tools, and user interactions. MongoDB Atlas stores and retrieves the data — documents, application records, knowledge sources, and vector embeddings. Voyage AI improves retrieval quality — embeddings for semantic search and reranking for precision. For a no-code builder, this means you can assemble a retrieval-augmented generation workflow visually. For a developer, it means the integration points are packaged as reusable Dify tools rather than one-off glue code. Meet the Extensions

2026-05-31 原文 →
AI 资讯

RAG Explained for Beginners: How AI Assistants Stop Making Things Up

I once submitted an essay with three citations that I hadn't personally verified. The AI had suggested them, and they sounded right. None of them existed. That's not a quirk or a bug — it's exactly how LLMs work. And once you understand why, a technique called RAG starts to make a lot of sense. AI assistants are remarkably good at sounding right. The model isn't lying — it's doing its best with what it knows. The problem is that what it knows has limits, and it doesn't always know where those limits are. Ask one about a recent event, a niche regulation, or anything from a source it's never seen — and it fills the gap anyway. Confidently. That's the gap RAG was built to close. Once you understand how it works, you'll have a much clearer picture of why some AI tools are genuinely reliable and others are just very convincing guessers. Here's what's actually going on. First, What's the Problem? Large language models (LLMs)—the technology powering AI assistants like ChatGPT and Claude—are trained on vast amounts of data from across the internet. That training gives them a remarkable ability to reason, summarize, and generate content. But it also comes with some real limitations: They have a knowledge cutoff. An LLM trained last year doesn't know what happened last month. They can hallucinate. When they don't know something, they don't say "I don't know"—they generate a confident-sounding answer anyway. Wrong facts, fake statistics, invented sources. All delivered with a straight face. They don't know your specific sources. Think of a software engineer asking an AI assistant about their company's internal API documentation, deployment runbooks, or architecture decisions. None of that is in the training data. The model has never seen it — and it will still try to answer. The model isn't lying — it's generating the most plausible answer it can. It just has no way to know when it's wrong. So, what do you do when you need an AI that's accurate, current, and knows your specifi

2026-05-31 原文 →
AI 资讯

I built a RAG pipeline from scratch — no LangChain, just FastAPI + FAISS

Most RAG tutorials I found were either "pip install langchain and you're done" or 50-page academic papers. I wanted something in between — a pipeline I could actually explain in an interview, where I understood every line. So I built one from scratch. No LangChain, no LlamaIndex, no frameworks. Just FastAPI, FAISS, sentence-transformers, and an LLM API. Here's what I built, what worked, and what broke. The architecture PDF --> extract text (pypdf) --> chunk (500 char, 50 overlap) --> embed (MiniLM-L6-v2) | v question --> embed --> FAISS top-k search --> build prompt with chunks --> LLM --> answer + sources Five Python files, ~300 lines total: File Responsibility main.py FastAPI app, 3 endpoints, prompt engineering pdf_loader.py PDF text extraction via pypdf rag.py Chunking + embedding store.py FAISS vector store wrapper llm.py Swappable LLM client (Groq / OpenAI / Anthropic) How the upload works When you POST a PDF to /upload , three things happen: 1. Text extraction — pypdf reads each page and returns the raw text. Pages with no extractable text (scanned images) are skipped. 2. Chunking — each page is split into ~500-character chunks with 50 characters of overlap. The overlap prevents losing context at chunk boundaries. CHUNK_SIZE = 500 CHUNK_OVERLAP = 50 def chunk_pages ( pages ): chunks = [] chunk_id = 0 for text , page_num in pages : start = 0 while start < len ( text ): end = min ( start + CHUNK_SIZE , len ( text )) chunk_text = text [ start : end ]. strip () if chunk_text : chunks . append ( Chunk ( chunk_id = chunk_id , text = chunk_text , page = page_num )) chunk_id += 1 if end == len ( text ): break start = end - CHUNK_OVERLAP return chunks 3. Embedding — each chunk is embedded into a 384-dimensional vector using all-MiniLM-L6-v2 . This runs locally on CPU, no API call needed. Vectors are normalized so we can use inner product as cosine similarity. def embed_texts ( texts ): model = get_embed_model () # lazy-loaded singleton vectors = model . encode ( texts

2026-05-31 原文 →
AI 资讯

The .txt File as the Soul of a Personal AI — FileRAG Memory Architecture

The .txt File as the Soul of a Personal AI — FileRAG Memory Architecture By Dharanidharan J (JD) Full Stack & AI Engineer | Building Jarvix The Problem Nobody Talks About Every chatbot tutorial teaches you the same thing: history = [] history . append ({ " role " : " user " , " content " : message }) And that works — until it doesn't. After 500 turns, your dict has forgotten who the user is. After 1000 turns, you're hitting token limits. After a restart, everything is gone. Redis helps with persistence but still buries early facts under noise. Vector DBs help with retrieval but bloat storage and need infrastructure. What if the memory itself was just a file? The Idea Every conversation a user has gets distilled into a plain .txt file. That file is the brain. On every new query, a hybrid BM25 + semantic RAG retrieves the most relevant chunks from it and injects them as context. users/ └── jd.txt ← the soul file The soul file looks like this: [Turns 1-5] - User's name is JD, software engineer - Building FileRAG, a novel memory architecture - Uses Pop!_OS with Fish shell and NVIDIA GPU [Turns 6-10] - Has a cat named Pixel who distracts during coding - Paused TaskNest due to burnout - Now focused on AgenticMesh Human readable. Editable. Yours. Why This Is Different Most memory systems store messages . FileRAG stores a relationship . System What it stores Dict / Redis Raw message objects Vector DB Embeddings of messages FileRAG Distilled understanding of the user The longer you use it, the more the AI understands you — not because it has more messages, but because it has a better summary of who you are. The Architecture User message ↓ Topic drift check (cosine similarity) ├── Drift detected → distill current buffer immediately └── No drift → continue ↓ Hybrid retrieval (BM25 + ChromaDB) from soul file ↓ Inject context → LLM responds ↓ Append to turn buffer ↓ Every 5 turns → distill → append to soul file → update ChromaDB ↓ Emergency distillation on exit (SIGINT/SIGTERM)

2026-05-30 原文 →
AI 资讯

Why output-stage PII masking is the wrong protective surface for data exfiltration in RAG

"The output filter runs after the LLM has already seen the confidential data. By then, three classes of leak can no longer be stopped. The right surface is retrieval. Walking through a real implementation." TL;DR Most RAG-with-RBAC stacks I see in production put the access-control gate at the output stage: an LLM-response post-filter that masks PII or redacts confidential strings. This is defense-in-depth, not the load-bearing layer. By the time the filter runs, the LLM has already received the confidential context, and three classes of leak — creative paraphrasing, inference, cross-turn persistence — can no longer be stopped by string-matching the output. The protective surface that actually carries the weight is retrieval-stage ABAC: documents and graph nodes the user can't read are never traversed, never make it into the prompt, never seen by the model. The output filter still belongs in the stack, but as the second-to-last line, not the first. This post is a walk through why and how, with code references from a working implementation. It was prompted by a 6-turn LinkedIn DM exchange with Ali Afana (Provia founder, dev.to Featured) on injection-fixture schema design, where the framing crystallized. The seductive default You build a RAG system. You have documents at different sensitivity levels — public, internal, confidential. You want the model to answer based on whichever documents the user is allowed to see. The default mental model: "I'll let the model answer freely, and then I'll filter the response on the way out." This is appealing because: The retrieval pipeline stays simple (one query, one vector search, one response) The access control feels surgical (just before the user, just before damage) The PII-mask vocabulary is well-established (Presidio, regex catalogs, named-entity recognition models) So you wire up something like: Python The seductive default def answer(query, user): chunks = retrieve(query, top_k=10) # No ABAC here context = "\n".join(c.text

2026-05-29 原文 →