What Inspired Me

I wanted to build something that feels like a real assistant, not just a chat UI. A lot of "AI demos" stop at text generation, but the most useful systems in practice have two missing ingredients:

  • Grounding: the agent must pull live context (trends, web context, images) rather than hallucinating.
  • Workflow: the agent should help a user move from signal (what's happening) to action (what to do next), in one conversation.

That inspired an agentic marketing copilot that can:

  • discover what's trending,
  • explain why it's trending with real sources,
  • generate campaign ideas and copy,
  • and even generate or edit images conversationally (e.g., marketing creatives).

What I Built

I built an Agentic AI Platform that supports classical agent orchestration:

LLM → Tool Call → Tool Result → LLM Final Answer

The user interacts via a chat interface. Under the hood, the agent can invoke tools like:

  • Google Trends: get the top trending searches (capped for context efficiency).
  • Trend Context Search: run a recency-filtered web search to explain why a trend is spiking.
  • Nano Banana (Gemini image tool): generate or edit images from a prompt, optionally using an uploaded user image.

The system also supports multiple model providers (Gemini, AWS Bedrock, and local/Ollama), so an agent can be configured with a model that fits the task.

How I Built It (Architecture + Implementation)

1) Classical Agent Orchestration

The first priority was getting the orchestration right. The behavior I enforced is:

  1. Send the system prompt + chat history to the LLM.
  2. If the LLM decides a tool is needed, it emits a structured tool call.
  3. The backend executes the tool.
  4. The tool response is appended into the same message history.
  5. The LLM is called again to produce a final, user-facing response.

That flow prevents hallucination and makes tool output truly part of the reasoning context.

2) Tooling Layer (Built-in Tools)

I implemented tools as "built-in" executables with JSON schemas. Each tool has:

  • a name,
  • a schema (required fields, defaults, max lengths),
  • an executor function that returns JSON.

This made tools modular and allowed the agent to evolve from "trends discovery" to "trends explanation" to "creative generation."

3) UI/UX for Real Users

A hackathon demo succeeds or fails on UX. So I built:

  • a chat UI that shows clean answers (not internal tool traces),
  • optional trace viewing (for debugging and transparency),
  • conversation management (including deleting conversations),
  • and image upload + image rendering directly inside chat.

One important design decision: tool internals should never leak into the main chat. The user sees a clean assistant answer; tool calls/results are only shown in a trace view.

4) Image Pipeline

For image generation/editing, I added:

  • an image upload endpoint,
  • storage for uploaded and generated images,
  • a tool that calls a Gemini image model to generate/edit images,
  • and frontend rendering of the result.

This enabled a natural conversation like:

"Here's my product photo. Make it look like a premium ad creative."

"Now try a neon cyberpunk version."

"Add a witty caption aligned with today's trend."

What I Learned

1) Orchestration is the product

The most valuable learning wasn't "prompting" or picking the best model. It was that agent reliability comes from orchestration:

  • strict tool-call formatting,
  • enforcing a final answer phase,
  • and sanitizing outputs so users don't see internal planning noise.

A model can be powerful, but without correct sequencing, it behaves inconsistently.

2) Context management matters more than raw intelligence

Even strong models degrade when:

  • tool outputs are too long,
  • irrelevant data is injected into the prompt,
  • or the system doesn't enforce structure.

Capping tool results and returning compact evidence was critical.

3) Debugging agents is a different kind of debugging

Typical debugging is deterministic. Agent debugging requires:

  • trace tooling (tool calls/results and intermediate steps),
  • loop guards (prevent repeated tool invocation),
  • and robust parsing (the model doesn't always produce perfectly formatted JSON).

Challenges I Faced (and How I Solved Them)

1) Tool hallucination vs tool grounding

Early behavior: the agent would "answer like it used the tool" without actually using the tool output.

Fix:

  • enforced tool-call → tool-result injection → final answer.
  • Added guards so tool-call turns contain only tool-call text.

2) Infinite tool loops

Sometimes the agent would repeatedly call the same tool.

Fix:

  • two-phase flow (planner + final answer).
  • Added caps and fallback behavior to force a final response.

3) Dirty UI output ("I'm invoking tool... stand by...")

This is common when models narrate their steps.

Fix:

  • strict "no internal reasoning / no tool narration" policy in final output.
  • Sanitization layer in backend and frontend.

4) Image responses and SDK variation

Image APIs can return different response structures and sometimes text-only outputs.

Fix: robust parsing paths and a fallback: if the tool returns useful analysis (e.g., "what's in this image?"), treat it as a valid response rather than an error.

5) Multi-provider credential setup

Integrating AWS Bedrock and Google/Gemini required careful config handling.

Fix: explicit credential wiring and environment validation so the system behaves predictably.

Why This Project Matters

This project demonstrates an end-to-end agentic workflow that's immediately useful:

  1. Discover what's trending.
  2. Understand why it's trending (with web evidence).
  3. Act on it (campaign ideas, copy, and creative generation).
  4. Iterate conversationally, including image edits.

It's not just "AI text generation." It's a system that connects live context to real outputs with reliable execution.

What I'd Do Next

If I had more time, I'd add:

  • structured "campaign brief" templates (brand voice, constraints, target audience),
  • evaluation hooks (did the agent cite tool evidence correctly?),
  • richer creative workflows (version history for generated images, compare variants),
  • and a proper "memory" layer so the agent remembers chosen trends and brand preferences across sessions.

Built With

Share this project:

Updates

Submission history