DEV Community

MUHAMMAD ZAID
MUHAMMAD ZAID

Posted on

Building an AI Agent When You Don't Have a Credit Card

I am a CS student from Jhelum, Pakistan. Last month I joined the Google Cloud
Gen AI Academy APAC, Cohort 3. Track 1 was to build a customer-facing AI agent
using ADK and RAG, deploy it, and submit the link.

I opened the Google Cloud console, went to the free trial, and got stuck on
Step 2 of 2: Payment Information Verification.

I don't have a credit card. Many students here don't.

I still finished the track. Here is how.

The agent

I built Brew Haven, a support agent for a coffee shop with branches in
Rawalpindi and Islamabad. You can ask it about the menu, prices, timings,
delivery, the loyalty card, or allergies.

Live: https://brew-haven-barista-by-zaid.streamlit.app
Code: https://github.com/Sudo-Zaid/brew-haven-barista

I asked it "in which cities you can deliver?" and it said:

We deliver within a 6 km radius of our branches in Rawalpindi (Committee
Chowk) and Islamabad (Bahria Town Phase 4). Delivery costs PKR 150, but it
is free on orders above PKR 2500.

Brew Haven chat answering which cities it delivers to

Every number there came from a markdown file I wrote. The model did not make
up anything. That was the point.

Why RAG and not just a big prompt

I could have pasted the whole menu into the system instruction. Two problems
with that. It costs tokens on every single message. And when the menu grows,
it gets worse.

So instead:

  • three markdown files hold the shop data (menu, policies, orders)
  • they get split by heading, so one chunk = one topic
  • each chunk is embedded once and cached
  • when a customer asks something, I embed the question and pick the top 3 chunks by cosine similarity
  • the agent gets those chunks through a tool called search_knowledge_base

The agent code is small:

root_agent = Agent(
    name="brew_haven_barista",
    model="gemini-3.6-flash",
    instruction=INSTRUCTION,
    tools=[search_knowledge_base],
)
Enter fullscreen mode Exit fullscreen mode

The real work is in the instruction. Two rules matter most:

  1. Always call the tool before answering anything factual. Never answer from memory.
  2. If the tool finds nothing, say you are not sure. Do not invent prices or policies.

Rule 2 is easy to skip and I think it is the most important one. If my agent
tells a customer the wrong refund policy, that is a real problem for the shop.
A chatbot that guesses is worse than one that says "I don't know."

I added one more rule after testing. If someone mentions an allergy, always
give the shared kitchen warning even if they did not ask. Now it says this on
its own:

...all our food is prepared in a shared kitchen that also handles nuts,
eggs, and wheat, so we cannot guarantee any item is completely allergen-free.

RAG cannot do that part. You have to think of it yourself and write it in.

Three problems I hit

1. No credit card = no Google Cloud.

Google Cloud free trial stuck at Step 2 of 2, Payment Information Verification

Google AI Studio gives you a Gemini API key for free with no card. It is rate
limited (5 requests per minute for me) but that is fine for a demo.

2. Hugging Face wanted PRO.
I first tried to deploy on Hugging Face Spaces. Streamlit is not an SDK option
there anymore, so I wrote a Dockerfile. Then I got 402 Payment Required
Docker and Gradio Spaces need PRO now. Only static Spaces are free.

I moved to Streamlit Community Cloud. Free, logs in with GitHub, made for
Streamlit apps. Better choice anyway.

The deployed app listed on the Streamlit Community Cloud dashboard

One thing to know: Streamlit secrets go into st.secrets, but my code reads
os.environ. So I added this:

try:
    if "GOOGLE_API_KEY" in st.secrets:
        os.environ["GOOGLE_API_KEY"] = st.secrets["GOOGLE_API_KEY"]
except FileNotFoundError:
    pass
Enter fullscreen mode Exit fullscreen mode

3. The model was retired.
First run gave me a 404: gemini-2.5-flash is no longer available to new
users, use gemini-3.6-flash. Many tutorials still use the old name. If you
get this error, your key is fine, just change the model.

What I learned

Ship somewhere, ship today. The track is named after Cloud Run but the
form asked for a "deployed project link". It did not say Cloud Run. A working
link is better than waiting for the perfect setup.

Keep data in files, not in the prompt. I can change a price by editing one
line. No redeploy of any logic.

Test what it refuses, not only what it answers. Ask it something that is
not in your documents and see if it admits it. Anyone can make a demo answer
the question it was built for.

The blockers were most of the work. I spent more time getting to a
deployable state than writing the agent. Nobody writes that part down, so I
did.

Next

Track 2 is a BigQuery data agent. I found out BigQuery has a sandbox that
works without a billing account, so the no-card path still works there.
Then Track 3, then the Ideathon.

If you are doing this from a country where the payment step blocks you: it is
solvable. Free tier and free hosting can take you all the way to a live URL.


Muhammad Zaid — LinkedIn · GitHub
Gen AI Academy APAC Cohort 3, Track 1 — Google Cloud x Hack2skill

Top comments (0)