SShortSingh.
Back to feed

Developer Builds Closed-Domain AI Assistant That Refuses to Guess Outside Its Knowledge Base

0
·1 views

A developer has built an agentic AI knowledge assistant designed to answer questions strictly from a predefined knowledge base, explicitly blocking responses based on the model's general pretrained knowledge. The system combines FAISS vector search and BM25 keyword search through a weighted hybrid scoring formula to improve retrieval accuracy. An agentic layer built with smolagents and the Qwen 2.5 72B model manages query handling, returning a fixed refusal message when the knowledge base lacks sufficient information. The project used tools including LangChain, Sentence Transformers, and Hugging Face Transformers, giving the developer hands-on experience with RAG pipelines and closed-domain AI design. Planned future improvements include PDF ingestion, persistent vector storage, a web interface, and a relevance gate to filter queries before they reach the language model.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Google Apps Script Gets Linux Sandbox Power via Gemini Managed Agents

Developers have outlined an architecture that connects Google Apps Script (GAS) with Gemini Managed Agents, which provision remote Linux sandboxes equipped with bash execution and full package management. GAS is a widely used automation tool for Google Workspace but is constrained by a restricted serverless runtime that lacks OS-level access, native binary support, and headless browsing. The new integration gives GAS access to a dedicated Linux container with 4 vCPUs, 16 GB RAM, Python 3.12, and Node.js 22, enabling workloads previously impossible within the platform. To avoid bottlenecks such as GAS's 50 MB response limit and Gemini's token-per-minute quota, generated files are streamed directly from the sandbox to Google Drive using the ggsrun CLI tool, bypassing API payload restrictions. The approach is designed to deliver high-throughput cloud automation without the token overhead or payload truncation issues associated with returning large binary data through the Gemini API.

0
ProgrammingDEV Community ·

Three Quick Checks Every Data Analyst Should Run Before Trusting a Dataset

A data practitioner has outlined a five-minute validation routine to catch hidden data quality issues before any analysis begins. The first step involves scanning for non-standard null representations—such as dashes, blank strings, or placeholder numbers like 9999—that standard null checks would miss entirely. Second, examining value distributions rather than relying on summary statistics like mean or median can reveal skewed or placeholder-heavy columns that aggregates obscure. Third, timestamp columns should be scrutinized for timezone inconsistencies, ingestion gaps, and logical contradictions such as creation dates appearing after update dates. The author argues that most costly analytical errors stem not from flawed models but from misunderstood input data, making early sanity checks far cheaper than correcting downstream mistakes.

0
ProgrammingDEV Community ·

Beginner builds full-stack movies app on AWS Fargate with Vue 3, Express, and DynamoDB

A developer with limited AWS experience built a fully deployed movies catalog app to document the process for other beginners. The project uses a Vue 3 frontend, an Express REST API, and DynamoDB for storage, all running inside Docker containers on AWS ECS Fargate. Traffic is routed through an Application Load Balancer, with infrastructure defined in code using AWS CDK and end-to-end tests written in Playwright. The author published the complete source code on GitHub alongside a detailed walkthrough covering architecture decisions, real errors encountered, and plain-English explanations of AWS concepts. The guide assumes only basic JavaScript and API knowledge, making it accessible to developers new to cloud deployment.

0
ProgrammingDEV Community ·

Tutorial: How to Keep Unspoken AI Responses Out of Voice Companion History

A developer tutorial on DEV Community addresses a subtle flaw in voice AI companions where partial or undelivered speech gets incorrectly logged into conversation history. Standard implementations append all transcript fragments — including incomplete speech recognition and interrupted model responses — into the next prompt, causing the AI to treat unconfirmed exchanges as established facts. The proposed fix treats conversation history as committed application state, meaning only a finalized user utterance and a fully played-back assistant response are recorded. The tutorial provides a TypeScript implementation enforcing four rules: provisional partial speech, final-only user input, post-playback assistant commits, and rejection of stale interrupted-turn events. The approach is scoped to the current voice session and is designed to integrate with real-time communication platforms such as Tencent RTC alongside OpenAI-compatible model providers.

Developer Builds Closed-Domain AI Assistant That Refuses to Guess Outside Its Knowledge Base · ShortSingh