SShortSingh.
Back to feed

Developer builds fully local AI assistant with Ollama, LangChain, and voice support

0
·1 views

A developer has built a fully local personal AI assistant from scratch using Ollama for the language model, LangChain/LangGraph for agent logic, faster-whisper for speech transcription, and Piper for text-to-speech synthesis, with all components running on-device. The project revealed significant limitations of small LLMs (around 8B parameters) in tool calling, where models sometimes printed raw JSON function calls as plain text instead of executing them properly. Smaller models also proved 'lazy' when generating structured outputs, such as writing placeholder comments instead of actual code when routed through tool calls — a problem that was solved by bypassing structured tool calling and using regex-based parsing instead. The developer also found that complex multi-step tasks like 'research and save' worked better when web searches were executed deterministically before invoking the LLM, rather than relying on the model to chain tools autonomously. Memory management emerged as another key challenge, requiring three distinct layers — in-session context, persistent conversation checkpoints via SQLite, and a separate long-term facts store — along with a summarization middleware to prevent unbounded context growth.

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 ·

Developer Builds Swipe-Based Tool to Help Beginners Find Open Source Issues

A developer has launched IssueSwipe, a web app that lets users discover open source contribution opportunities by swiping through GitHub issues like a card-based interface. The tool addresses a common pain point where beginners struggle to find suitable issues amid thousands of repositories and outdated or already-resolved tickets. IssueSwipe pulls contribution-friendly issues tagged 'good first issue' or 'help wanted' via the GitHub GraphQL API and personalises recommendations based on programming language, experience level, and interests. The platform includes gamification features such as XP points, daily streaks, developer ranks, and a bookmark system to track issues from saved through to merged pull requests. Built with Next.js, TypeScript, and Prisma, IssueSwipe is itself open source, and the developer plans to add AI-powered recommendations, leaderboards, and team contribution modes in future updates.

0
ProgrammingDEV Community ·

How to Build a Bounded Async Polling Workflow with Seedance and n8n

Video generation APIs like Seedance return a task ID rather than an immediate result, requiring automation workflows to poll for completion over time. A tutorial published on DEV Community demonstrates how to build a production-ready n8n workflow that submits a video generation request exactly once and reliably tracks its status. The workflow uses a configurable polling budget — defaulting to 120 polls at 5-second intervals, totalling roughly 10 minutes — with a hard upper limit to prevent infinite loops. A parallel state-carrying branch preserves the task ID and loop counter across iterations, preventing the HTTP response from overwriting critical configuration. The workflow handles all terminal states — success, failure, and timeout — through explicit conditional branching nodes.

0
ProgrammingDEV Community ·

HTTP 200 Does Not Mean Your AI Agent Actually Read the Page

A developer tool called FetchGate addresses a subtle but critical flaw in AI web-retrieval agents: an HTTP 200 status code confirms only that bytes were delivered, not that meaningful content was received. When a fetch returns an empty JavaScript shell, a bot-challenge screen, or a disguised error page, AI agents typically proceed to answer anyway using their training data, with no indication in the transcript that the retrieval failed. Existing solutions such as RAG faithfulness checkers and citation UX tools evaluate whatever text arrives after the fact, but do not verify whether the intended resource was actually fetched. FetchGate intervenes at the fetch boundary itself, classifying each retrieval as RETRIEVED, FAILED, or UNKNOWN, and hard-stops the pipeline before the model can generate a response based on missing or wrong content. The core argument is that the real danger was never token cost but the silent gap between a technically successful request and an actual page read.

0
ProgrammingDEV Community ·

1913 Inventory Math Reveals the Optimal Moment to Restart an AI Coding Session

A developer analyzed roughly 150 Claude Code sessions spanning over 1,000 transcripts to determine the most cost-efficient point at which to restart an AI session. The study found that context in large language model sessions behaves like warehouse inventory, where holding accumulated tokens incurs a compounding 'rent' cost through repeated cache reads, while restarting carries a one-time rebuild cost. By mapping this trade-off onto the Economic Order Quantity formula developed by Ford Harris in 1913, the developer derived a square-root equation to calculate the optimal session length. Key variables include the provider's cache write-to-read price ratio, the size of the working context floor, and average per-turn token growth. Under Anthropic's pricing the formula suggests restarting around 39 turns, while a provider with a higher cache ratio like DeepSeek shifts that threshold beyond 120 turns.

Developer builds fully local AI assistant with Ollama, LangChain, and voice support · ShortSingh