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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
V
V2EX
PCI Perspectives
PCI Perspectives
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
WordPress大学
WordPress大学
V
Vulnerabilities – Threatpost
H
Heimdal Security Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - 叶小钗
V
Visual Studio Blog
Jina AI
Jina AI
P
Proofpoint News Feed
罗磊的独立博客
SecWiki News
SecWiki News
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 热门话题
Security Archives - TechRepublic
Security Archives - TechRepublic
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
N
News and Events Feed by Topic
NISL@THU
NISL@THU
T
Tailwind CSS Blog
T
Tenable Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Recent Announcements
Recent Announcements
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Tor Project blog
宝玉的分享
宝玉的分享
Help Net Security
Help Net Security
S
Security Affairs
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
G
GRAHAM CLULEY

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
A Board Game agent built using Sanity Context and Vercel's AI SDK | Sanity
Jarod Reyes · 2026-05-27 · via Hacker News - Newest: "AI"

I love board games. They are a very good excuse to entice my kids away from their books and spend some time with the parents. Plus I think I read somewhere that they increase neuroplasticity and I could use plenty more of that.

I decided to use Sanity Context to build an agent that recommends games based on my interests. Sanity Context is an MCP server. MCP (Model Context Protocol) is an open standard for connecting AI agents to external data and tools. Any agent that supports MCP can connect to it: Claude, GPT-4o, whatever you're building with for your next project. In this tutorial I'll walk through the key steps so you can follow along or use your favorite coding assistant to build something similar.

If you'd like to follow along with the full code files checkout this repo:

What we're actually building

Before we dive in any further let's see this thing in action:

I asked the agent, using GPT-4o, to recommend a new cooperative board game for my family that uses narrative story telling and city-building. When I tried this same query with OpenAI's latest GPT 5.5 model it was not able to find me a board game made later than 2023. Instead my agent recommended a top-rated game from this year called Cozy Stickerville.

Notice that my agent didn't guess. Behind the scenes it ran a GROQ query (GROQ is Sanity's open-source query language) against our Content Lake and returned a game that was released in 2026, has both mechanics tagged in their records, directly from BoardGameGeek's (BGG) API. Rad, let's build it.

The recipe

By the end of this tutorial you'll have:

  • A Sanity project with a boardGame schema, populated from BGG's XML API
  • A configured Context plugin for Sanity Studio that scopes an AI agent to your board game data
  • A rather robust agent module that answers natural-language questions by running real GROQ queries against your own Content Lake (this is where you should spend the most time customizing).

For this demo specifically I wanted to focus on the build patterns of building an agent with Context and show that agents can live in different interfaces - which means there is no frontend. It's a CLI, ya' dig?

Prerequisites

  • Node.js 20+nodejs.org. Run node --version to confirm.
  • A Sanity account — free at sanity.io
    You can create an account using npm create sanity@latest as shown below
  • A BoardGameGeek XML API token — registration is required. Create an application at boardgamegeek.com/applications, then create a token and send it as Authorization: Bearer … on every API request. See Using the XML API.
  • An OpenAI API key — the agent script uses GPT-4o by default. You can swap in any Vercel AI SDK provider.
  • A deployed Sanity Studio — studio is where you configure Context for the agent.

Create a Sanity project

Follow the prompts. When asked to install the MCP server, choose yes, it allows you and your agent to interact with Sanity's docs and tools directly.

Expected output:

Your project ID will now be in will now be in sanity.config.ts. Keep it handy, we'll need to add this to the .env file.

Or clone from GitHub: Clone the repo, run npm install, then run:

This will walk you through logging in and selecting (or creating) a project, and automatically write your projectId and dataset to a .env file. Then copy any remaining variables from .env.example and update sanity.config.ts and sanity.cli.ts to match.

Define the board game schema

In Sanity, a schema is a TypeScript definition that describes the shape of your documents, what fields they have, what types those fields are, and how they're validated. It's the contract between your content and everything that reads it: Studio uses it to render the right editing form, your frontend uses it to know what to expect, and Context uses it to expose your data structure to the AI agent.

The default Studio template includes a placeholder schemaTypes/index.ts with a sample type. We're going to replace that with the actual boardGame document type and split it into its own file while we're at it, which is the convention for maintainable Sanity projects.

Create a new file at schemaTypes/documents/board-game.ts:

Then update schemaTypes/index.ts to import from it:

The mechanics and categories arrays are what make the GROQ queries genuinely useful later - they let the agent filter by structured tags rather than approximate text matching.

Next we need to deploy the schema to Content Lake so the Sanity Context server knows your data shape, we'll use the following sanity deploy command which has the added benefit of deploying our studio as well.

Pull board game data into Content Lake

Install the XML parsing package:

Create ingest.mjs at the project root. This is not the full file, but gives you the shape. You can see my version here: https://github.com/jarodreyes/boardgame-sanity-cli/blob/main/ingest.mjs

Create a .env file at the project root. For Sanity, go to sanity.io/manage, open your project, click API → Tokens, and create one with Editor permissions. For BGG, use the bearer token from Applications → Tokens for your registered app.

Run the ingestion:

Why we use getCliClient()

`getCliClient()` picks up your projectId, dataset, and apiVersion directly from sanity.config.ts — no duplication. The `--with-user-tokenflag` passes your active sanity login session to the script, so you don't need a separate SANITY_API_TOKEN environment variable for local ingestion runs. You only need an API token when running in a non-interactive environment like CI.

Expected output:

BGG's thing endpoint accepts at most 20 IDs per request; the script batches automatically and waits 2 seconds between batches.

Start the Studio (npm run dev, then open localhost:3333). After the default small ingest you should see on the order of ~60 board games; each with ratings, complexity weights, mechanics, categories, player counts, playtime ranges, and designer credits from BGG.

Install Sanity Context

Sanity Context is an MCP server. Once configured in your Studio, it gives any MCP-compatible agent three tools to work with: initial_context (a compressed overview of your schema and document count), groq_query (live GROQ access to your Content Lake), and schema_explorer (field-level inspection so the agent builds accurate queries without guessing at field names).

Sanity ships a skill that automates the Context configuration. Run it from your coding assistant and it handles the plugin install, Context document creation, and MCP URL setup.

To set it up manually:

Open sanity.config.ts and add the plugin:

Restart the Studio after the config change.

Create the Context document

In the Studio sidebar, you'll see a new Context section. Click it, then Create new Sanity Context. Fill in these fields:

Save the document. The Studio generates an MCP URL (the API path includes a date version, e.g. v2026-04-09 — use exactly what Studio shows, not a guess):

Copy it.

Connect the agent

Create agent.mjs at the project root:

AGENT_SYSTEM_PROMPT

The system prompt is worth understanding because it controls how the agent queries your data. It sets the query strategy (what to try first, how to widen if a query returns zero results), the BGG-specific field conventions (exact tag strings like "Co-operative Play" rather than the casual phrase "co-op"), and the temporal logic (how the agent interprets "new" or "recent" relative to the current date).

The prompt in this repo was written with help from the Sanity Context skill and iterated against real queries. It's detailed because GROQ is precise. A vague "find cooperative games" won't match anything if the agent guesses at a field name. The tradeoff is token cost per call: a longer system prompt means slightly higher cost per query, but it cuts down on the number of follow-up tool calls the model needs to make.

You'll want to customize this for your own data. The field names, array values, and fallback logic are all specific to the BGG dataset. Swap those out for your schema and you have a solid starting point.

The agent script depends on two more packages: the Vercel AI SDK (ai) and an OpenAI provider (@ai-sdk/openai). Install them with npm:

Worth pausing here on what an agent loop actually is. When you call generateText, the model runs in a loop rather than responding once and stopping. The model decides to call a tool, the SDK executes that tool against your MCP server, the result comes back to the model, and the model decides what to do next. That cycle continues until the model has enough information to give a final answer, or until it hits the stopWhen limit.

In this agent, that means the model is running live GROQ queries against your Content Lake mid-conversation, reading real results, and deciding whether it needs more data before responding. The retrieval happens inside the loop, driven by the model.

The OpenAI provider is the adapter that connects generateText to GPT-4o. The Vercel AI SDK supports other providers too, so if you'd rather use Anthropic or Gemini, swap the provider import and you're good.

Add three more variables to .env. Create a Sanity API token with Viewer permissions:

This pattern works for your data too

Now you can start building your own agents on top of your content. Here are a few queries that show just how precise this gets:

The agent runs a GROQ expression against real records, reads the result, and gives you an exact answer. It counts array lengths, finds maximums, traverses references, whatever your schema supports.

Swap out board games for a product catalog, a documentation site, a recipe database, or a content library. The architecture is the same. The agents you build for your users get smarter the more you invest in your content, not because a new model dropped, but because your data got better.

What's happening under the hood

When you ask the agent a question, it reaches the Sanity Context MCP server. The agent doesn't retrieve context and answer from memory. It runs queries, reads the results, and builds its response from live data. The instructions in the Context document guide how it frames and presents those results.

On top of all this, you can wire up any agent, using any AI you want, and have complete control of the experience for you or your end user/customer… all using Javascript/Typescript/language of your choice.

Your Sanity content becomes structured data the agent can query with the precision of a database.

I am proud to say that after the agent recommended Cozy Stickerville, I actually went and bought it, excited to play it with the fam tonight.

If you are building with Sanity Context or want help figuring out how to use it for your work join our Discord. We will be having some live sessions showing off agents built with Sanity and it'll be a great place to ask questions.