DEDUPED Hot AI repos, turned into use cases Get 5 a day

How to query a SQL database while redacting personal data before the LLM sees it with Baize

Ask questions about a PostgreSQL, MySQL, SQL Server, Oracle, or Dameng database with privacy protection on.

Credentials. Database connection details and passwords are required, and the README only describes where the LLM API keys are stored in `.env`, so confirm where database credentials are kept before you add them.

Who it is forA data analyst who needs answers from a company database that contains phone numbers, emails, or ID numbers.

The problemSending raw database rows with personal data to a cloud LLM exposes that data.

The outcomeBaize queries the database through the RDBMS MCP server, redacts personal fields before the LLM sees them, and restores the original text in its answers.

What you need first

  • Python 3.10 or newer with pip
  • An API key for DeepSeek or another supported backend, or a local Ollama install
  • Optional: IBM SPSS Statistics or a reachable SQL database, depending on the use case

Steps

  1. pip install -r requirements-data.txt
  2. For SQL Server only: install Microsoft ODBC Driver 18 for SQL Server at the system level, because pyodbc alone is not enough.
  3. Add your database connection to the MCP server settings; the README names the MCP protocol but does not show the exact config format, so check the project documentation. (inferred, check the README)
  4. baize
  5. At the >>> Decree: prompt, type /privacy to confirm privacy protection is on, then ask your question about the database.

Prompt for your agent

Using the Baize CLI from the Xu123-Bob/Baize repo with privacy protection on, ask it to count rows in <table-name> of <database-name> and summarize the result. Expected output: a row count and a short summary with no raw personal values. Verify that no phone number or email appears in the LLM-facing prompt log.

Caveat. The README does not show how to configure the RDBMS MCP server, so the connection step must be confirmed from the project documentation.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page