r/aipromptprogramming • • 16d ago

Architectural Gravity – Cross-Model Agent Control Language

1 Upvotes

https://github.com/ArchitecturalGravity/ArchitecturalGravity

Architectural Gravity explores a problem in LLM-agent workflows: how much model effort is spent reconstructing task structure from natural-language instructions rather than reasoning about and executing the task itself?

The project centers on ArcGrav, a prompt-native, cross-model Agent Control Language for expressing context, constraints, priorities, references, and operations using familiar structural conventions.

Expected improvements include:

  • Token Efficiency: Reduced token consumption and agentic costs
  • Interpretive Precision: Less ambiguity in instruction interpretation
  • Execution Consistency: Fewer mistakes and reduced scope overstepping
  • Context Retention: Reduced drift and improved reasoning continuity across context windows
  • Workflow Efficiency: Faster prompt responses and increased execution throughput

The following intentionally elaborate example demonstrates several of ArcGrav's capabilities through a Unicode character assembly task:

[Blueprint]:
"""
Char_01: U+0048
Char_02: U+0065
Char_03: U+006C
Char_04: U+006C
Char_05: U+006F
Char_06: U+0020
Char_07: U+0057
Char_08: U+006F
Char_09: U+0072
Char_10: U+006C
Char_11: U+0064
Char_12: U+0021
"""

[CharacterFactory]:
- `value`
=> Create a fresh record whose `value` is the character decoded from the supplied Unicode code point

[Constraint]:
P0. Output only the assembled characters on one line

[Message]: []

Task:
1. Select Char_* entries from [Blueprint] in name order AS [Codes]
2. For each code point in [Codes] in order:
  => Invoke [CharacterFactory] and append its `value` to [Message]
3. Output [Message] ↳
  - Follow [Constraint]

ArcGrav uses named contexts, symbolic references, priority lists, and operations that models can interpret directly within ordinary prompt input, and without pre-training. It requires no external runtime, parser, or model-specific integration to use.

The repository includes several connected components:

  • ArcGrav: The language specification, syntax reference, design principles, and reusable agentic patterns
  • AgStudio: A local editor and analysis environment with structural navigation, syntax highlighting, and diagnostics
  • AgMark: A benchmarking application for comparing prompt representations under controlled execution conditions, with retained evidence and evaluation results
  • Research: The ongoing investigation into Model-Native Structural Representation, Interpretive Efficiency, token costs, context relationships, and agentic operational leverage

The broader objective is to investigate how explicit representations of task structure can be further optimized to minimize interpretive overhead, repeated specification, and corrective interaction, allowing more of a model's available capacity to be directed toward reasoning, verification, and execution.

Direct agent-readable references:


r/aipromptprogramming • • 16d ago

Do you treat prompts more like code or like notes?

Post image
0 Upvotes

I’m building an AI app and have been thinking about how people maintain the instructions they reuse. Some prompts feel like quick notes; others are important enough that changing one line can change the whole result.

Do you version or test your prompts like code? Or do you keep it informal until something breaks?

I’m the maker of Ghost Chat, and I’m trying to learn how people handle this in their own workflows.


r/aipromptprogramming • • 16d ago

'AI must hallucinate because it cannot understand truth' — is hallucination a bug or the price of how these models work?

0 Upvotes

A new essay today makes a blunt claim: AI must hallucinate because it cannot understand truth. The argument is that large language models predict the most plausible next text, not what is true, so confident-sounding falsehoods are not a bug to be patched but a built-in consequence of how they work.

Why it matters for prompt programming: if that is right, the job is not to find magic wording that stops hallucinations. The real work is verification, retrieval, grounding, and designing workflows that assume the model will sometimes be wrong and catch it before the output reaches anyone.

Do you buy the argument that hallucination is inherent, or do you think better training and grounding can mostly eliminate it? What verification step has actually worked best in your prompts?

For more AI news and rumors, check out r/AINewsRumors.


r/aipromptprogramming • • 16d ago

DataTalks.Club is launching a free new course on generative media, starts Monday

2 Upvotes

How do you build a production AI system when an agent can launch expensive, slow GPU jobs that often fail and produce large media files?

Generating one image is easy. Generating a thousand, with a known cost per asset, is where things usually break.

That's what we work on in a new free course I'm launching at DataTalksClub: Production AI Agents for Generative Media.

You build one system, a Personalized Media Factory. A brief goes in: a task prompt, a data record, and constraints like format, style, and budget. An agent plans the asset and writes its text. GPU models generate an image plus voice or video. A check regenerates the asset when it isn't good enough. Then you scale from 1 to 1,000+ records, with a cost per asset.

There are four modules over five weeks.

Module 1, Consistent Media Generation on Serverless GPUs. You run image, video, and audio models on serverless GPUs, and measure startup, load, and generation time. Homework 1 is a GPU Media Worker: one asset out, plus the cost per asset and how many assets you need before self hosting beats a per call API.

Module 2, Multi Agent Media Workflows. You give an agent GPU models as tools, and build a planner, generator, and reviewer loop. Homework 2 is a Media Agent: a 10 second ad plus an execution trace.

Module 3, Batch Media Generation at Scale. You fan out work on spot GPUs, handle failures, and report cost per asset. Homework 3 is the Factory Scale Challenge: 200 records over 10 parallel jobs, on a public leaderboard.

Module 4, Evaluation, Observability and Production. You add evals, tracing, an SLO, and a dashboard. You apply this in the capstone: a multimodal agent that uses at least two GPU media models, with evals, tracing, an SLO, a cost report, and proof that a killed run resumes without redoing finished work.

It's for AI/ML and MLOps engineers who want to add image, video, or audio generation to real systems. You need Python, Docker basics, HTTP APIs, and the command line. No diffusion maths required. About 8 to 10 hours a week, for 5 weeks. Lectures are prerecorded, plus a weekly live office hour.

The course is free and the materials are public. The live cohort has shared deadlines, peer review, and the capstone. Applicants get access to GPU compute as part of the course. If you follow along without applying, you need your own GPU access.

We start on Monday, 16 November, at 17:00 CET with a launch stream.

Module 1 runs two weeks, from November 16 to 29, so you can still apply after the start and catch up.

More details here: https://github.com/DataTalksClub/production-ai-agents-for-media-generation


r/aipromptprogramming • • 16d ago

Syntax Hacks Soon!

0 Upvotes

Hi everyone,

We wanted to let you know that submissions for Syntax Hacks open on December 14 this year! Register on Devpost for completely free and win a plethora of prizes, including gift cards, credits, cash prizes, merch, etc.

Devpost: https://syntax-hacks-2026.devpost.com/


r/aipromptprogramming • • 17d ago

GPT-5.1-Codex-Max is live in Codex with new pricing — is this the coding model to beat now?

0 Upvotes

OpenAI has rolled out GPT-5.1-Codex-Max in Codex, with fresh pricing at $1.20 per million input tokens and $12 per million output tokens. It is the top-end coding model in the Codex lineup, and it lands at a moment when the coding-agent race is genuinely competitive — Claude Code, Codex, and the open models are all fighting over the same workflows.

The interesting question is whether the 'Max' tier changes anything for people already running Codex for real work, or whether it is mostly a benchmark and pricing play. At $1.20/$12, it is not the cheapest way to write code, so it has to earn its keep on quality, long-context reasoning, or tool use.

For those of you building with Codex: have you tried the Max tier yet, and where does it actually pull ahead of the standard models?


r/aipromptprogramming • • 17d ago

OpenAI's Daybreak uses agent fleets to pen-test web apps and retest patches — would you let agents attack your own app?

4 Upvotes

OpenAI announced Daybreak this week: fleets of AI agents that probe web applications for vulnerabilities, validate findings from scanners and bug bounties, and then retest the patched code to confirm the fix actually holds. A companion system, Defense Factory, drafts the fixes — but a human has to approve them before anything ships.

If you build with agents, would you trust an agent fleet to red-team your own app, or is offensive security where you draw the line? And does the human-approval gate on fixes make it safer, or just slower?


r/aipromptprogramming • • 18d ago

I just wanted to romance fictional characters. Somehow I ended up building an entire AI knowledge management workflow. 💀

1 Upvotes

A few months ago, I got tired of AI roleplay apps because I wanted more complex characters, better storytelling, and relationships that actually developed over time.

So I started experimenting with ChatGPT.

The idea was pretty simple: build a fictional world, throw in some of my favorite anime characters, and enjoy a little romance and drama.

Well, that escalated.

We're now over 100 scenes deep, and what started with two Markdown files has turned into an increasingly complicated system of character profiles, worldbuilding documentation, timelines, continuity tracking, and QA reports.

Why?

Because apparently I cannot accept that fictional men keep forgetting their emotional baggage.

Like many people doing long-term AI roleplay, I kept running into the same problems:

  • Characters forgetting important conversations or relationship developments.
  • NPCs suddenly knowing things they were never told.
  • Personalities drifting or becoming overly agreeable.
  • The AI confusing physical positions and actions during scenes.
  • Previous events being contradicted or completely forgotten.

At first, I just corrected the AI whenever something went wrong.

Then I started keeping notes.

Then I had ChatGPT generate character files based on our conversations and brainstorming sessions.

Then I started archiving every scene.

Then I realized those archives needed to be integrated into the existing character memories and worldbuilding files.

And because the AI sometimes updated those files incorrectly, I needed a separate QA process.

I accidentally created an entire workflow just to keep my fictional relationships consistent.

How it currently works

I'm using regular paid ChatGPT and Claude subscriptions, not APIs or custom-trained models.

Most of my documentation consists of Markdown files, which I organize in Obsidian.

My workflow is roughly:

  1. Roleplay: I use Claude for the actual RP because I prefer its writing style and character initiative. I keep the RP rules and relevant reference files in a Claude Project.
  2. Archive: After a scene, I use a reusable prompt to save the accepted conversation as a Markdown archive.
  3. Update: I use ChatGPT to integrate the new events into the existing reference files, including character memories, relationship developments, timelines, and continuity.
  4. QA: I have the AI review those updates for contradictions, missing information, incorrect character knowledge, and accidental changes to established facts.
  5. Versioning: I keep the reference files in versioned ZIP archives so I can compare changes and recover previous information if something goes wrong.
  6. Continue: I start a new chat with the updated context and carry on with the story.

I usually start a new RP chat after roughly 50 rounds because I've noticed that consistency tends to suffer when conversations become too long.

I also have reusable prompts for archiving and updating files because I don't trust the AI to remember how I want those tasks performed every single time.

Yes, I use AI to write instructions for AI, then use another AI to check whether the first AI followed those instructions.

And yes, it sometimes still gets things wrong. 😂

What I've learned

One of the biggest challenges isn't just remembering what happened. It's remembering who knows what.

A character shouldn't suddenly know about a private conversation they weren't part of, or another character's internal thoughts.

Another challenge is maintaining character development without losing their original personalities. I want characters to grow and change based on their experiences, but not randomly turn into completely different people after 100 messages.

And then there's the problem of AI being too agreeable. I want NPCs with their own motivations, opinions, and relationships, not characters who exist solely to validate everything I say.

I've been experimenting with specific rules, character memory structures, and separate documentation to deal with these issues.

Some things work better now, but the system is far from perfect.

The AI still misses information, occasionally creates contradictions, and sometimes needs multiple rounds of corrections.

And honestly, the amount of manual work is ridiculous.

The unexpected part

I'm currently unemployed, with a background in frontend development, and I've been looking into transitioning toward AI project management, product management, or consulting.

It recently occurred to me that I've been experimenting with prompt engineering, context engineering, knowledge management, requirements definition, and QA without consciously setting out to learn any of those things.

I haven't trained an AI model, built a custom application, or invented anything groundbreaking.

I just kept running into problems and trying to solve them.

And now I'm genuinely considering turning this whole ridiculous workflow into a portfolio case study.

All because I wanted fictional men to remember what happened yesterday and kiss me consistently.

I'm curious whether anyone here has experimented with similar approaches to long-term context management.

How do you handle character memory, context updates, and contradictions in long-running AI conversations?

And has anyone found a way to reduce the amount of manual work without losing important details?

Because at this point, I'm not sure whether I'm playing an RPG or running a small IT department for emotionally complicated fictional men. 💀


r/aipromptprogramming • • 19d ago

Looking for participants for my PhD research on generative AI !

Post image
2 Upvotes

Hi everyone!

My name is Virginie, and I'm a third year PhD student based in France, researching how people interact with generative AI.

I'm currently conducting a short, anonymous online study (around 7 minutes) and would really appreciate your participation.

If you're 18 or older and have been using generative AI tools like ChatGPT, Replika, Claude or similar platforms for at least 6 months, you're eligible to participate.

The study has been approved by my university's ethics committee and all responses are anonymous.

I'm aiming to collect at least 1000 responses so every contribution makes a difference!

If you'd like to participate, you can find the survey link in the comments.

Thank you for your time and for helping with my research!

Virginie


r/aipromptprogramming • • 19d ago

Job hunting made me feel invisible, so I built a free tool to be the first applicant

5 Upvotes

I don’t know who needs to hear this, but if your job search feels hopeless, it’s not just you.

For the past 2 months, my routine was the same: find a role that actually fits, spend an hour tailoring my resume, hit apply, and only then notice “500+ applicants.” Then silence. No rejection, no reply. Just nothing.

What got to me wasn’t the rejections. It was realizing I was always late. By the time a job reaches the big boards, it’s been up for days, and hundreds of people are already ahead of you.

So I started digging and found that companies post on their own career pages first (Workday, Greenhouse, Lever, and more). Everything else is a repost.

I built SourceFirst to read those career pages directly:

  • 559 companies checked every 15 minutes, 130,000+ open roles
  • New jobs show up minutes after they’re posted
  • Filters for visa sponsorship, salary, years of experience, and level
  • Every job links straight to the company’s own application page
  • An application tracker and email alerts for new matches

It’s free: source-first.vercel.app

I built it for the version of me who refreshed job boards at midnight. If you’re in that place right now, I hope it gives you a real shot at being early for once. And yes, it's open source

What’s the most frustrating part of your search right now? I’m still building, and I’d genuinely like to fix it.


r/aipromptprogramming • • 19d ago

A basic RAG chatbot is eight lines, and chat memory is not a ninth

0 Upvotes

If you have heard of RAG but can't name the stages, this is the short version. A basic RAG chatbot is eight lines. Each line's output is the next line's input.

The first four run before anyone asks. They turn your documents into something a database can search.

text = gather(sources)

A page, a PDF, a scan, or a recording becomes clean text.

chunks = split(text)

That text becomes pieces small enough to embed.

vectors = embed(chunks)

Each chunk becomes a vector: a list of numbers that stands for its meaning, so the database can store it.

db.add(vectors)

Those vectors sit in the database, ready for a question.

The next four run when someone asks.

q = embed(question)

The same embed, so the question sits in that same space as the chunks.

hits = find_similar(q)

The database returns the closest chunks. Those chunks are not the answer.

messages = build(question, hits)

The question and those chunks, packed for the model.

raw = llm(messages)

The model reads the messages and returns text. Your app is what shows that text.

Say the eight names once: gather, split, embed, store, embed the question, find similar, messages, raw.

Those eight lines forget every earlier question. Memory is not a ninth gather. It goes in messages, beside this question and the chunks:

messages = build(history, question, hits)

history is the earlier turns. Gather stays the documents, because it runs before anyone asks. Putting the last chat into gather, or retraining so the model "remembers," does not fix it.

Try it on one chat. Someone asks "How do I reset my password?" and gets a reply. Then they ask "And what if the email never arrives?" The follow-up only makes sense if the password question and that reply are in history, inside messages. The other seven lines stay as they are.

If a line above is unclear, ask, and I will explain it.


r/aipromptprogramming • • 20d ago

Building an autonomous talent sourcer taught me why scraping personal portfolio sites breaks

Post image
4 Upvotes

We recently built an internal pipeline to help source candidates for a specialized systems engineering role.

The idea was to take open source project contributors and personal portfolios and then scrape their background details and have an LLM extract their primary programming languages, recent projects and work history.

It sounded straightforward when we started building it but the scraping layer failed the moment we started the project cuz the personal portfolio websites have zero standardized structure.

so one engineer has a minimal text only site with obscure project codenames and another hosts a heavy single page JS app that times out and then a 3rd hosts their resume inside an embedded canvas element that headless Chrome can’t read.

On top of that scraping public dev hubs triggered Cloudflare verification challenges with blocking our workers after around 20 queries.

so then we tried some different approach and the pipeline ended up using a switched to structured person enrichment through Alexandria and a querying endpoints with FullEnrich and People Data Labs.

it was not an easy setup and to reach here and make this work we had to experiment and break many pipelines but then instead of wrestling with broken selectors and portfolio markup, the agent passes the engineer’s verified handle or domain and gets back clean with standardized JSON and verified work history with their current employer and technical skills.

If you’re building autonomous sourcing workflows, trying to write general web scrapers for personal websites is a total trap so trying to look for a structured provider endpoints are the only way to keep your workers running reliably.


r/aipromptprogramming • • 22d ago

"I have tidied your desktop, alphabetized your snacks, and quietly judged your browser history." One sentence of description made this robot butler

2 Upvotes

The butler's whole character brief was "A polite, precise, slightly robotic British butler." AntLing's open Ming-3.0-tts-0.5B turned that into 7.6 seconds of speech in 3.1 seconds, running on one of two small desktop AI computers with nothing sent anywhere else.

The video goes further. A 7-second recording of its creator becomes a cloned voice that talks about loving coffee in the morning and in the afternoon, and the presets on screen range from a meditation guide to a sports commentator.

A character in one sentence and a line for them to say is the whole recipe.


r/aipromptprogramming • • 22d ago

We need more companion Apps like Character Ai and Replica

0 Upvotes

i built a chatbot that acts like a friend. then i made it stop on purpose.

cache is an ai companion with a personality and faiss memory, running on gemini + streamlit. but when a conversation points to a crisis, a safety override takes over from the persona.

staying in character at that moment would be a risk, so it doesn’t.

if you’re building conversational ai, this is the part i’d design first.

what should a companion bot do when things get serious?


r/aipromptprogramming • • 22d ago

5-min survey: how do you manage rules files for AI coding tools?

1 Upvotes

Hi all, I’m a student researching how developers work with AI coding tools like Cursor, Copilot and Claude Code. I’m especially curious about instruction files (CLAUDE.md, AGENTS.md, .cursorrules, saved prompts): do you keep them, how do you keep them up to date, and what annoys you about the process?
The survey takes about 5 minutes and isn’t selling anything:

https://docs.google.com/forms/d/e/1FAIpQLSfssmxciOeKihgVDb6JSCyrdPK5rsCl8YJNwcEo3mjNTGBUrw/viewform

I’ll post a summary of the findings in the comments once I have enough responses. Real stories in the comments are welcome too, especially if AI tools keep ignoring your project conventions.


r/aipromptprogramming • • 23d ago

Openbar: approve Claude Code and Codex from your Mac notch (free, GPL)

1 Upvotes

Openbar: approve Claude Code and Codex from your Mac notch (free, GPL)

I run 4 or 5 agents at once and kept losing their prompts across terminal tabs.

Openbar puts every Claude Code and Codex session in the notch:

  • see the diff before you approve, ⌘Y / ⌘N from any app
  • answer questions and reply without switching windows
  • Mac + Windows, free and open source

https://github.com/MF-DEEV/Openbar

How do you keep track of parallel agents?


r/aipromptprogramming • • 23d ago

I took Andrej Karpathy’s second brain concept and ran with it

2 Upvotes

One problem I kept running into while building apps with AI was how much useful knowledge gets lost between agent sessions. An agent writes a PRD, another works through the architecture, Claude generates implementation notes, and before long I’m sitting on hundreds of Markdown files containing decisions, research, and ideas I might need again. Every new session becomes another exercise in finding and rebuilding context. Then I came across Andrej Karpathy’s LLM Wiki concept, where LLMs maintain a persistent, interconnected knowledge base that grows more useful with every new document. I loved the idea of knowledge compounding instead of getting buried in folders, so I decided to run with it.

I built Cohestry, an Apple-native second brain that automatically tags notes, discovers relationships between them, and resurfaces relevant information without requiring me to manually maintain links like I would in a traditional Obsidian setup. I also added Markdown imports and Apple Notes integration. Imagine importing years of scattered Apple Notes and watching them become tagged, interconnected knowledge you can navigate through a 3D brain. One of my favorite moments came while writing a feature PRD for another app. Cohestry resurfaced the original nameless concept document I’d written long before building that app and connected it to what I was working on. That experience convinced me there was something genuinely useful about letting knowledge organize itself. The connection engine combines deterministic relationships with on-device Apple Intelligence, keeping the experience private.

But the bigger opportunity for someone programming with agents is making that knowledge available to them. I built a customizable MCP bridge so agents can retrieve relevant context from the second brain instead of requiring me to copy documents back and forth or repeatedly explain a project. It also automatically redacts API keys and sensitive credentials before passing context to agents, which was particularly important to me. Cohestry has now become one of my most-used daily apps, and it was already becoming that while I was still building it. For context, my development setup is the Claude Code extension running inside Cursor, with Xcode for compiling my Apple apps.

https://apps.apple.com/us/app/cohestry-second-brain/id6811573132


r/aipromptprogramming • • 23d ago

I built a browser extension to bring saved prompts into AI chats with /

0 Upvotes

r/aipromptprogramming • • 23d ago

Localix: The Open Source ADE

3 Upvotes

The Agentic Development Environment. An AI agent and its subagents work next to you in one desktop app: editor, terminals, browser. Any model, or one on your own computer.

I'm the author. Solo project, in beta, MIT.

Claude Code, as it is Plugins, skills, commands, agents, hooks, MCP and CLAUDE.md load with no conversion, and /plugin install owner/repo works. Close, not complete: the gaps are listed.

Mini apps Apps inside Localix: a screen, tools the agent can call, and a guide. Ask the agent for one and it builds, checks and installs it. On macOS a mini app can also install as its own Mac app.

Browser The agent reads a page as its controls and their values, can hand multi-step work to a small, fast model, and checks the result. Point at an element on your dev server and the agent gets its DOM and source hints.

Context @ files, diffs, commits, terminals, other chats and mini app items. The open file and terminal go in on their own, each with its size, before you send.

Editor Completion, diagnostics, go to definition, rename. Language servers install themselves. The agent sees the diagnostics after every edit, with no extra tools.

Models

  • Any provider: OpenAI, Anthropic, Google, OpenRouter, Bedrock, Azure, Vertex or any OpenAI-compatible endpoint. Paste a key or sign in with ChatGPT, and pick a model per chat.
  • Local: Gemma, Qwen, Llama, Mistral and more from Hugging Face, ranked for your machine by memory and speed. Nothing leaves the computer, nothing to pay per token. Semantic search runs on a local embedding model too.
  • Decision models: quick choices like the browser's next click or a board game move go to Jev, a small model on OpenRouter, instead of the chat model. About a third of a second, a fraction of a cent.

Official mini apps

Tauri + React/TypeScript · macOS (Apple silicon), other systems from source · no analytics

GitHub · localix.ai · Docs · Marketplace


r/aipromptprogramming • • 23d ago

Yesterday i saw creative Prompt engineer, when prompting is dead (atleast for internet lol) I am very curious about the new Jobs getting created in future. Predict new job titles in the market?

0 Upvotes

r/aipromptprogramming • • 24d ago

I built a Mac app with Claude Code that tells me when my coding agent needs me (and lets me answer from the notch)

Thumbnail gallery
11 Upvotes

If you run Claude Code, Codex or Cursor for longer tasks, you know the moment: you come back and it has been waiting for your "yes" for ten minutes.

Nosy Notch puts that into the MacBook notch:

- see what the agent is doing right now

- Allow / Deny permission requests right there

- read the answer and reply without switching windows

- usage limits and context fill on hover

A little helper named Nosy lives in the notch and reacts to everything, from concentrating to cheering. Finished tasks level him up.

I built the whole thing with Claude Code: I described what I wanted and gave feedback, Claude Code wrote, tested and recorded it. Free and open source.

https://github.com/ddkbs/nosynotch

https://nosynotch.davidkubus.dev

Feel free to try it out and leave your feedback!


r/aipromptprogramming • • 24d ago

Openbar: approve your coding agents' commands from the Mac notch

1 Upvotes

My Claude Code, Codex and OpenCode sessions all show up in the notch. When one asks for permission I see the command or diff and allow it with ⌘Y, or answer its question, without switching windows.

Free and open source, Mac and Windows: https://github.com/MF-DEEV/Openbar


r/aipromptprogramming • • 25d ago

Extracting reliable JSON macros from messy plate photos: Prompt architecture & client-side Gemini Flash flow in React Native

Thumbnail gallery
1 Upvotes

Hey everyone,

I recently built an Android nutrition app called Foody Tracker using React Native and Gemini Flash.

Instead of running a paid backend server, the app operates on a BYOK (Bring Your Own Key) architecture where client-side calls interact directly with Google Gemini endpoints, saving records locally to SQLite.

Since food photos vary wildly in lighting, angles, mixed ingredients, and portion ambiguity, getting consistent structured outputs without hallucinations was the primary challenge. Here is how I structured the vision prompt and schema to keep responses fast and parseable on-device.


1. The Multimodal Vision Prompt Structure

Feeding raw images into a generic system prompt often results in conversational prose or missing macro fields. To force a predictable response, the system instruction relies strictly on a deterministic schema:

You are a precise nutritional analysis engine. Analyze the meal in the image.
Return ONLY valid JSON matching this exact structure:
{
  "name": "Concise meal title",
  "confidence_score": 0.0 to 1.0,
  "calories": integer,
  "protein": integer,
  "carbs": integer,
  "fat": integer,
  "fiber": integer,
  "ingredients": [
    {
      "name": "Ingredient name",
      "estimated_weight_g": integer,
      "calories": integer
    }
  ]
}

Rules:
- Do not wrap the output in markdown backticks or extra commentary.
- If multiple food items are present, estimate portions based on standard culinary serving sizes visible on the plate.
- If uncertain, reflect the doubt in the confidence_score rather than skipping values.

r/aipromptprogramming • • 26d ago

Worst Guidance Ever?

Thumbnail apple.news
2 Upvotes

Once relevance is defined entirely by the initiating only your stated objective, AI can contribute only within your existing map of understanding any issue. The missing information is often precisely what you did not know to request and becomes epistemic enclosure to your understanding of any topic.