惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
P
Privacy & Cybersecurity Law Blog
The Hacker News
The Hacker News
博客园 - 司徒正美
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
I
Intezer
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Scott Helme
Scott Helme
T
Threat Research - Cisco Blogs
T
Tailwind CSS Blog
月光博客
月光博客
Recent Announcements
Recent Announcements
博客园 - 叶小钗
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
A
Arctic Wolf
B
Blog RSS Feed
Recorded Future
Recorded Future
D
DataBreaches.Net
有赞技术团队
有赞技术团队
Project Zero
Project Zero
U
Unit 42
T
Tor Project blog
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
CERT Recently Published Vulnerability Notes
博客园 - Franky
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Security Latest
Security Latest
C
Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
H
Heimdal Security Blog
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
S
Securelist

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Build an AI teammate to help with your Postgres
Rishi Raj Ja · 2026-04-28 · via DEV Community

Think about those times on team calls when a simple question like “Can someone check the latest sales numbers?” puts the meeting to a pause while someone goes through dashboards or runs a query. It gets awkward and slows everyone down. Now imagine if your teammate was an AI that could listen in, fetch answers from your live database, and explain them right there as part of the conversation that would require no context-switching, no waiting, and just give you natural explanations as you talk.

In fast-paced teams (especially those where not everyone is a database whiz), having an AI teammate that can jump into your calls and patiently answer questions about your Postgres data can be a great help. It acts as a built-in tutor for clarifying, demonstrating, and even breaking down tricky SQL results in plain language for any team member. This isn’t about fancy interfaces or replacing people, but making it easy for anyone (whether they’re technical or not) to just talk and understand what’s happening in the data, together.

In this tutorial, we build exactly that kind of AI teammate. Instead of piecing together complex infrastructure (audio pipelines, transcription, NLP, TTS, avatars), we'll use Vision Agents to tie everything together, using Stream's WebRTC APIs, and give the AI both a voice and a human-like video presence using ElevenLabs voice and Anam avatars. The system we’ll create can listen, query Postgres, and respond during your calls, making your organization’s knowledge more available and accessible, all through a single participant in the meeting.

Demo

Prerequisites

You will need the following to get going with the implementation:

Create a Stream Application

  • Navigate to the Stream dashboard.
  • Select + Create an App.
  • In the dialog, enter a name for your application and choose the appropriate region for your edge-server location(s).
  • After creation, locate the API Key and Secret under Your Credentials.

Stream Application Overview

  • Add these credentials to your .env file as follows:
   STREAM_API_KEY="your-api-key"
   STREAM_API_SECRET="your-api-secret"

Enter fullscreen mode Exit fullscreen mode

Configure ElevenLabs

   ELEVENLABS_API_KEY="your-elevenlabs-api-key"

Enter fullscreen mode Exit fullscreen mode

Configure Deepgram

  • Go to the Deepgram dashboard.
  • In the left sidebar, click API Keys.
  • Select Create a New API Key.
  • Add the generated key to your .env file:
   DEEPGRAM_API_KEY="your-deepgram-api-key"

Enter fullscreen mode Exit fullscreen mode

Configure OpenAI

   OPENAI_API_KEY="your-openai-api-key"

Enter fullscreen mode Exit fullscreen mode

Configure Anam

   ANAM_API_KEY="your-anam-api-key"

Enter fullscreen mode Exit fullscreen mode

  • Access the Anam Build view.
  • Click Avatar, hover your desired avatar, and click Copy ID.

Anam Avatar ID

  • Add the ID to your .env file:
   ANAM_AVATAR_ID="your-anam-api-key"

Enter fullscreen mode Exit fullscreen mode

That's it for configuring your environment variables. Next, let's move on to scripting the helpful AI teammate for Postgres.

Set up a new Python application

In this section, you will learn how to create a new Python application, set up vision agents in it, and install relevant libraries for a quick implementation.

Let’s get started by creating a new Python project. Open your terminal and run the following commands:

mkdir my-db-agent && cd my-db-agent
uv init && uv add "vision-agents[anam,deepgram,elevenlabs,getstream,openai,redis]" python-dotenv asyncpg httpx

Enter fullscreen mode Exit fullscreen mode

Now, create a .env file at the root of your project. You are going to add the items we saved from the above sections.

It should look something like this:

# .env

## Stream environment variables
STREAM_API_KEY="..."
STREAM_API_SECRET="..."
EXAMPLE_BASE_URL="https://demo.visionagents.ai"

## OpenAI environment variable
OPENAI_API_KEY="sk-proj-..."

## Deepgram environment variable
DEEPGRAM_API_KEY="..."

## ElevenLabs environment variable
ELEVENLABS_API_KEY="sk_..."

## Anam environment variables
ANAM_API_KEY="..."
ANAM_AVATAR_ID="...-...-...-...-..."

## Postgres environment variable
DATABASE_URL="postgresql://neondb_owner:...@ep-...aws.neon.tech/neondb?sslmode=require&channel_binding=require"

Enter fullscreen mode Exit fullscreen mode

Then, create a main.py file with the following code:

from dotenv import load_dotenv
from vision_agents.core import Agent, AgentLauncher, Runner, User
from vision_agents.plugins import deepgram, elevenlabs, getstream, openai

# Load environment variables from a .env file for secrets and configuration
load_dotenv()

async def create_agent(**kwargs) -> Agent:
    """
    Factory function to create and configure an Agent for a group call assistant.

    Returns:
        Agent: An instance of a ready-to-use Agent.
    """
    agent = Agent(
        stt=deepgram.STT(eager_turn_detection=True),  # Deepgram for speech-to-text
        tts=elevenlabs.TTS(),  # ElevenLabs for text-to-speech
        edge=getstream.Edge(),  # GetStream edge network for AV transport
        llm=openai.LLM(model="gpt-5.4-nano"),  # OpenAI LLM (model specified)
        agent_user=User(name="Assistant", id="agent"),  # Agent's identity
        instructions=(
            """You are a helpful voice assistant and database assistant."""
        ),
    )
    return agent

async def join_call(agent: Agent, call_type: str, call_id: str, **kwargs) -> None:
    call = await agent.create_call(call_type, call_id)
    # Context manager handles join and clean-up automatically
    async with agent.join(call):
        await agent.finish()


if __name__ == "__main__":
    # Entrypoint for CLI: launches agent and runs the join_call automatically when invoked from the command line
    Runner(AgentLauncher(create_agent=create_agent, join_call=join_call)).cli()

Enter fullscreen mode Exit fullscreen mode

The code block above sets up a voice agent capable of joining group calls with real-time speech-to-speech AI features. It loads secret credentials from a .env file, then creates an agent that uses Deepgram for speech-to-text (transcribing what people say) with eager_turn_detection=True for faster responses and more natural turn taking, ElevenLabs for text-to-speech (making the agent talk back), OpenAI for language understanding and reasoning, and Stream as the underlying audio/video transport. The create_agent function initializes and configures this agent with a helpful voice assistant persona, while the join_call defines how the agent joins and waits for the call to end gracefully to exit automatically.

Bring Your Agent to Life with an Anam Avatar

Anam adds a real time interactive avatar to the agent. The avatar speaks with natural movements and automatic lip sync, which makes a voice agent feel like a present participant on a video call instead of an invisible bot.

Vision Agents ships an Anam integration as a processor. A processor in this context is a flexible building block i.e. it can be an avatar like Anam, a computer vision model (like YOLO), or any custom Python code designed to intercept raw WebRTC audio and video streams, perform some manipulation or transformation, and then republish the processed result back into the Stream call. For Anam, the processor takes audio output from the agent, streams it to the Anam service, and then publishes the resulting animated avatar video and audio as part of the group call experience.

Make the following changes to add Anam avatars to your agent:

# existing imports

+ from vision_agents.plugins.anam import AnamAvatarPublisher

async def create_agent(**kwargs) -> Agent:
    ...
    agent = Agent(
        ...
        instructions=(
            """You are a helpful voice assistant and database assistant."""
        ),
+        processors=[AnamAvatarPublisher()],
    )

    return agent

# rest of the file

Enter fullscreen mode Exit fullscreen mode

The code block above integrates Anam avatars into your agent by importing AnamAvatarPublisher and adding it to the agent's processors list, enabling the agent to produce a real-time animated avatar in calls.

Enable Postgres Access via Function Calling

Vision Agents supports function calling, which lets the LLM call real Python functions during a conversation. In the code block below, the agent uses one tool called postgres_query to run SQL against Neon and return rows back to the model.

This approach avoids creating a separate tool for each database operation. Instead of writing tools like list_tables, get_user_by_id, and create_invoice, the agent exposes one query tool and the LLM generates the SQL string it needs for the question, calls the tool, then uses the returned rows to respond.

When the agent hears a question like "How many failed payments happened last week", the LLM decides that it needs database context. The LLM composes a SQL query, calls postgres_query with the SQL string, and then uses the returned rows to produce a final spoken answer on the call.

# existing imports

+ import os
+ import asyncpg

async def create_agent(**kwargs) -> Agent:
    ...
    agent = Agent(
        ...
        instructions=(
            """You are a helpful voice assistant and database assistant.
+            You are an expert in Postgres database and can perform read or write operations against the database for the requirements of the user.
+            When asked about anything for a database, use the postgres_query function.
            """
        ),
        ...
    )

+    @agent.llm.register_function(
+        description="Run a read or write SQL query against Postgres and return rows."
+    )
+    async def postgres_query(sql: str) -> list:
+        """
+        Execute a read or write query against the Postgres database
+        """
+        database_url = os.getenv("DATABASE_URL")
+        if not database_url:
+            return [
+                "DATABASE_URL is not set. Set DATABASE_URL (e.g. postgres://user:pass@host:5432/db)."
+            ]
+        sql_stripped = sql.strip().lower()
+        print(sql_stripped)
+        conn = await asyncpg.connect(database_url)
+        try:
+            rows = await conn.fetch(sql)
+            return [dict(row) for row in rows]
+        finally:
+            await conn.close()

    return agent

# rest of the file

Enter fullscreen mode Exit fullscreen mode

The reason you need to tell the AI (LLM) to use the postgres_query function in its system prompt/instructions is because function calling in Vision Agents (using OpenAI-compatible models) relies on explicit instructions for when a function should be invoked. The model doesn't have internal knowledge of your codebase, so it will only attempt to use a registered tool/function (like postgres_query) if you clearly instruct it that "for any database-related questions, use this function."

Without this guidance, the LLM might try to answer database questions generically, or guess at the code's capabilities, which leads to hallucinations or missed opportunities to use your live data. By stating in the system that it should call postgres_query for all database operations, you're making the tool discoverable and ensuring the agent automatically composes and runs SQL as needed.

How to Run

To launch the service locally, use the following command in your terminal:

uv run main.py run

Enter fullscreen mode Exit fullscreen mode

It will open a demo at https://demo.visionagents.ai and automatically join the session for you. You can then interact with your agent in real time, as demonstrated in the demo.

Ending Thoughts

Building this really got me reflecting on where tech is going. With tools like Vision Agents, we're quickly entering a world where complex tasks (like voice, video, or even database operations) can be "offloaded" to robust agents just by describing what you need in simple words on a video call. The technology infrastructure is shaping up to let you plug in speech pipelines, switch to real-time conversation, keep improving with context, and better observability tools. It's an exciting time, more and more of the heavy lifting is shifting from brittle code to smart agents you direct in natural language.