Skip to content
Y
yTube.SITE v8.0.4
media / worlds / tools / internet oddities
YouTube / video information

Build Your Own AI Agent with Ollama — No Frameworks, Just Plain JavaScript and HTML

Video information, playback and saved actions.

Build Your Own AI Agent with Ollama — No Frameworks, Just Plain JavaScript and HTML

Description: Build your own AI agent from scratch — without frameworks or libraries, only Ollama and browser.
Everything happens in a single HTML file, from UI to brain:
• The chat widget UI — avatar section, chat box, input + Send button, styled as a clean dark widget by an AI assistant with pure CSS
• The system message that gives our agent "Ozzy" its personality
• set_avatar — an ACTION tool, defined as a JSON schema (default / drunk_wizard)
• wiki_search — a DATA tool: queries the free Wikipedia API (no key needed, CORS-friendly) and returns results as a JSON string
• The complete tool-calling loop against a local Ollama /api/chat: assistant → tool_calls → role:"tool" → final answer — with the avatar actually changing on command
• Real debugging
Tech: plain HTML/CSS/JavaScript + Ollama, running entirely on your machine.
⚠️ Tip: serve the project over http://localhost (e.g. `python3 -m http.server`) — opening the page via file:// will break your API calls due to CORS.
🔗 Code: https://gitlab.com/cabalbl4/al_ml_lectures/-/tree/main/lecture_1
🔗 Ollama: https://ollama.com
🔗 Ollama chat API: https://docs.ollama.com/api/chat
🔗 Wikipedia API: https://www.mediawiki.org/wiki/API

Chapters:
00:00 Intro - meet Rubi, the AI co-host
01:09 Building the HTML skeleton (image / chat / input sections)
04:04 Styling the widget with AI (dark theme CSS)
07:01 How the model sees your chat — templates, roles & tool calls
10:09 Reviewing the generated CSS
10:45 JS setup: picking a model & the Ollama chat API
13:05 The messages array & the system message
15:46 Send handler, fetch POST & why stream:false
20:03 First run - the CORS trap & the localhost fix
22:18 Rendering replies in the chat box
23:50 Building the agent loop
26:51 Defining tools in JSON — set_avatar
30:49 Reading tool_calls: id, name & arguments
36:31 Debugging the loop (the avatar finally changes!)
42:56 wikiSearch - the Wikipedia search function
45:14 wiki_search tool definition & wiring it up
50:30 Ada Lovelace test
52:05 Full agent stress-test: avatars + Wikipedia searches
53:02 How the agent loop ends (stop reason)
53:33 Wrap-up - code on GitLab
54:49 Rubi's goodbye & your homework
If this helped - like, subscribe, and drop a comment: what tool would YOU give your agent first?

#AI #MachineLearning #MLOps #LLM #Ollama #AIagents #Education #TechTutorials Close description
      
Videos related to "Build Your Own AI Agent with Ollama — No Frameworks, Just Plain JavaScript and HTML"

Related videos are temporarily unavailable.

Try again, or come back later.