2026 m. birželio 10 d., trečiadienis

Fix: AMD External Monitor Blinks & Disconnects on Linux (But Works on Windows)

Your external monitor randomly blinks, the picture jumps back to the laptop screen for a few seconds, then reconnects on its own — but on Windows everything is perfect. Here's exactly why it happens on Linux with an AMD GPU, how to confirm it from the logs, and the one-line fix that solves it for most people.

The symptom

You have an external display plugged into an AMD-powered laptop. From time to time:

  • The external screen blinks / goes black for a moment.
  • Everything jumps to the laptop's built-in panel only.
  • After a few seconds the external monitor reconnects by itself.
  • On Windows, with the same cable and monitor, it never happens.

It's intermittent, it's annoying, and because Windows is fine you assume it's not the hardware. Let's prove what it actually is.

Step 1: Read the kernel log

Right after the next blink, open a terminal and run:

journalctl -k -b | grep -iE 'dpcd|link training|retrieve_link_cap|resuming'

If your machine has the same problem, you'll see a line like this:

kernel: [drm:retrieve_link_cap [amdgpu]] *ERROR* retrieve_link_cap: Read receiver caps dpcd data failed.

That single line is the whole story.

Step 2: What that error means

Your monitor is connected over DisplayPort (a native DP port, a USB-C→DP cable, or a dock). When the GPU brings the link up, it must read the monitor's capabilities — called DPCD (DisplayPort Configuration Data) — over a tiny side-channel in the cable known as the AUX channel.

When that AUX read fails, the driver can't negotiate the link, so it drops the external output. The picture falls back to the laptop panel. A moment later it retries, the read succeeds, and the monitor comes back. That is exactly the blink–disconnect–reconnect cycle you see.

Step 3: Why Windows is fine but Linux isn't

This is the part most guides get wrong. If the same cable and monitor work on Windows, the physical link is good enough — so the difference is in how each driver handles a marginal link. The real cause is usually a combination:

  1. Windows retries silently; amdgpu gives up and logs an error. When a DPCD/AUX read hiccups, the Windows AMD driver does aggressive, invisible retries before you notice. Linux's amdgpu is less forgiving — it logs the failure and tears the output down. Same glitch, different reaction.
  2. Power management — the real Linux-specific trigger. amdgpu enables an aggressive display power-saving feature called PSR (Panel Self Refresh). Entering and exiting PSR re-touches the display link and disturbs the AUX channel — exactly the channel that's failing. Windows often tunes this very differently or leaves it off.
  3. Driver/firmware maturity. Windows ships the vendor's fully-tuned driver; amdgpu has had a steady stream of AUX/link-training fixes across kernel releases.

In short: the link is slightly marginal, Windows hides it, and Linux's PSR power-saving exposes it.

The fix: disable Panel Self Refresh

The highest-yield software fix is to tell amdgpu to keep the display link awake instead of letting it nap. You do that with a kernel boot parameter: amdgpu.dcdebugmask=0x10.

On Ubuntu / Debian-based distros that use GRUB:

# 1. Back up the GRUB config
  sudo cp /etc/default/grub /etc/default/grub.bak

  # 2. Edit GRUB_CMDLINE_LINUX_DEFAULT, e.g. change:
  #      GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
  #    to:
  #      GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.dcdebugmask=0x10"
  sudo nano /etc/default/grub

  # 3. Regenerate the boot config
  sudo update-grub

  # 4. Reboot
  sudo reboot

After rebooting, confirm it's active:

cat /proc/cmdline

You should see amdgpu.dcdebugmask=0x10 in the output. Done.

What amdgpu.dcdebugmask=0x10 actually does

dcdebugmask is a bit-mask for the amdgpu driver's Display Core. Each bit switches off one display feature. The value 0x10 maps to a single bit: disable PSR (Panel Self Refresh).

PSR is a power-saving feature: when the on-screen image isn't changing, the GPU stops actively driving the panel and lets the display hold its last frame from its own memory. Great for battery — but the transitions in and out of PSR are what disturb the AUX channel and cause your dropout. Turning it off keeps the link continuously active. The only real cost is slightly higher idle power draw.

Because it's a bitmask, you can combine values by adding them:

ValueDisables
0x2Memory "stutter" power saving
0x8Clock gating
0x10PSR (Panel Self Refresh) ← the fix
0x12PSR + stutter (0x10 + 0x2)

Note: exact bit meanings can shift slightly between kernel versions, but PSR = 0x10 is stable on kernel 6.8.

If it still happens

  1. Stronger mask: use amdgpu.dcdebugmask=0x12 (PSR + stutter). Same edit, swap the value, update-grub, reboot.
  2. Update kernel + firmware for newer AUX/link-training fixes:
    sudo apt update && sudo apt full-upgrade
  3. Reduce link stress to confirm the link is genuinely marginal — lower the monitor's refresh rate (e.g. 60→50 Hz) or resolution. If the blinking stops, your cable/port is at its bandwidth limit.
  4. Then improve the hardware: swap to a known-good, properly-rated DisplayPort / USB-C cable and remove any dock or adapter from the path.

How to undo the change

sudo cp /etc/default/grub.bak /etc/default/grub
  sudo update-grub
  sudo reboot

Summary

  • Symptom: external monitor blinks, drops to the laptop panel, reconnects — only on Linux.
  • Log signature: retrieve_link_cap: Read receiver caps dpcd data failed from amdgpu.
  • Cause: a slightly marginal DisplayPort/AUX link that Windows hides with silent retries, while Linux's amdgpu — especially its PSR power-saving — exposes it.
  • Fix: boot with amdgpu.dcdebugmask=0x10 to disable Panel Self Refresh.
Blogger tips when you paste - Use the HTML view (the <> icon), not the Compose view — otherwise Blogger escapes the tags. - After pasting, switch to Compose to preview; the
 blocks render as code boxes.
  - Suggested title: Fix: AMD External Monitor Blinks & Disconnects on Linux (But Works on Windows)
  - Suggested labels: Linux, AMD, amdgpu, DisplayPort, Ubuntu, Troubleshooting, External Monitor
  - In Search Description (Settings sidebar of the post), paste: AMD external monitor blinks and disconnects on Linux but works on Windows — caused by amdgpu PSR. Fix it with amdgpu.dcdebugmask=0x10.

  The same content is saved in the file amd-external-display-blinking-linux-blogger.html if you'd rather copy from there. Want a version with inline CSS styling (colored code boxes, a highlighted "fix" callout)
  so it looks nicer on your Blogger theme?

2025 m. gruodžio 22 d., pirmadienis

Kelionės

Bendra info:

https://cafeandcowork.com - Coworking places

https://ryanestrada.com/learntoreadkoreanin15minutes/ - Learning Korean alphabet

Travel-map


Balis

https://evisa.imigrasi.go.id/ - Viza
https://www.unifiedhealingbali.com/classes - Visokie renginiai vyksta

Korea

National Foundation Day in Korea, celebrated on October 3rd, commemorates the legendary founding of the first Korean kingdom, Gojoseon, by Dangun in 2333 BCE.

The highest peak in Korea is Hallasan (Mount Halla), located on Jeju Island. Hallasan rises to 1,950 meters.

Korean (Hangul) is the official language.

Arrival card can be filled online to save time.

Apps:
Navigation - Naver Map
Taxy: Uber

Coworking:

Coworking spaces can be found on Navel maps by searching: studycaffe or 스터디 카페



https://www.behongli.com - Very nice coworking place in Behongli

https://cafeandcowork.com/seoul/

https://www.digitalnomadskorea.com/post/best-coworking-spaces-seoul



Seul

https://english.visitkorea.or.kr Information about interesting places 

Foods:

Somaek is a popular South Korean beer cocktail made by mixing soju and beer, typically a lager. The name comes from "soju" (소주) and "maekju" (맥주, beer)
 
Bibim-naengmyeon (비빔냉면) is a popular Korean dish of cold, chewy noodles mixed with a spicy, sweet, and tangy sauce, typically enjoyed during hot weather-much like Lithuanians eat šaltibarščiai (cold beet soup) to cool down in summer. The name means "mixed cold noodles": bibim = mixed, naengmyeon = cold noodles.

Tteokbokki: Spicy Korean Rice Cakes
Tteokbokki (떡볶이) is a classic and beloved Korean street food made from chewy rice cakes simmered in a fiery, sweet, and savory chili sauce. Sometimes transliterated as "Tampuki" in other languages, this dish is instantly recognizable for its bold red color and comforting, addictive taste.


The Korean savory pancake traditionally served with rice wine is called
Pajeon (파전). The pancake is typically paired with makgeolli (막걸리), a traditional Korean milky rice wine. 
Pajeon (Korean Scallion Pancake)
Pajeon gets its name from the Korean words pa (scallion) and jeon (foods that have been pan-fried in a batter). It is a popular comfort food, especially on rainy days, as the sizzling sound of the pancake cooking is said to resemble the sound of rain. 
🔗

Busan

Gamcheon Village - village created in Korea war when people migrated, after retaking Seul people moves out busat, and left towns empty.
Haeundae Blueline

Park Tour

Jeju:
 

Japan

Hiroshima

https://dive-hiroshima.com/en/information/wifi-area/ - Wifi areas

 

Osaka

Taivanas

 

https://www.likeitformosa.com  - English Walking Tours
https://en.youbike.com.tw/ - Važinėjimas dviračiu (reikalingas Taiwano numeris) 

Belief:

Good grades good life


Liuqiudrifting ball" or "island chain" Xiaoliuqiu - Lambai Island
 

Kaohsiung  -  "high hero"

Amitabha Buddha statue

Taipei

To Study Languages -  NTNU Universitetas.

Meetup groups 

 

Tainan

https://www.twtainan.net

 

Kaohsiung

https://khh.travel/en/attractions/must-visit
https://khh.travel/en/attractions/map

 

What to do - 
https://www.travel.taipei/

https://tw.forumosa.com/ 

Renting info

https://www.roc-taiwan.org/lt_en/post/760.html - Mokymasis Taiwane kalbos, aplikacija iki kovo 31

 

Nuomos svetaines:
https://www.591.com.tw/#

https://www.booking-wise0.com.tw

https://myroomabroad.com


Tailandas

https://www.agoda.com/

 

 

Svetainės pasiskaitymui


https://www.nomadlyf.com/muscat/guide
https://nomadpub.com/tel-aviv-fors-againsts/






Turkija:


https://coliving.com/spaces/fec98brz

https://nomads.com/coworking/istanbul - Žemėlapis

http://sahibinden.com - Nuoma Turkijoje veikia tik su vpn

Graikija


Gidas:

Ko vengti:
https://www.ratepunk.com/blog/post/places-to-avoid-in-athens-safety-guide

Transportas:

https://www.hellenictrain.gr/en - Traukiniai

https://www.rome2rio.com/ - Įvairūs būdai

Žemėlapis
https://hoodmaps.com/athens-neighborhood-map

 

Apratamentai:

https://coliving.com/greece

https://mobee-house.com/apartments/

 

Skrydžiai:

https://www.skyscanner.net/


Website to rent:

https://www.spitogatos.gr/

https://www.theblueground.com/furnished-apartments-athens-greece


Guides:

https://www.twoticketsanywhere.com/digital-nomad-athens/ - good


https://localnomads.com/digital-nomad-guide/athens-greece/

https://www.amysuto.com/desk-of-amy-suto/working-remotely-in-athens-greece




Bendri:

https://coliving.com/

https://www.numbeo.com/cost-of-living/gmaps.jsp - Kiek kainuoja pragyvenimas


WhatsApp Groups:

https://docs.google.com/spreadsheets/d/1eNsQI2yyt4q06JEZIL0INflROZ4aOqSXfu9Ni5mQm1I/edit?gid=0#gid=0

2025 m. gruodžio 9 d., antradienis

Krishnamurti and stuff

Idomios svetainės kurias radau, iš vieno interiu su Reza Gabjavi:

 https://inthepresenceofk.org/issues/

2025 m. spalio 12 d., sekmadienis

WireGuard Guide for Ubuntu

WireGuard Complete Guide for Ubuntu
🔒 WireGuard Complete Guide
Ubuntu Server Setup & Configuration
1 🔄 Update System

Always start by updating your system packages to ensure you have the latest security patches and dependencies:

sudo apt update && sudo apt upgrade -y
💡 Tip: The -y flag automatically confirms the upgrade prompt. Remove it if you want to review packages before upgrading.
2 📦 Install WireGuard

Install WireGuard and required tools:

sudo apt install wireguard wireguard-tools -y

For Ubuntu 18.04 and earlier, you may need to add the PPA first:

sudo add-apt-repository ppa:wireguard/wireguard sudo apt update sudo apt install wireguard wireguard-tools -y
3 🔑 Generate Keys

Generate private and public key pairs:

wg genkey | sudo tee /etc/wireguard/private.key sudo chmod 600 /etc/wireguard/private.key sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key
⚠️ Security Note: Keep your private key secure! The chmod 600 command ensures only root can read the private key.
4 ⚙️ Configure WireGuard

Create and edit the WireGuard configuration file:

sudo nano /etc/wireguard/wg0.conf

Add the following configuration (example for server):

[Interface] # Server configuration PrivateKey = <your_server_private_key> Address = 10.8.0.1/24 ListenPort = 51820 SaveConfig = true # Enable IP forwarding (for server/gateway setups) PostUp = echo 1 > /proc/sys/net/ipv4/ip_forward PostUp = iptables -A FORWARD -i wg0 -j ACCEPT PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE [Peer] # Client 1 PublicKey = <client_1_public_key> AllowedIPs = 10.8.0.2/32 # Optional: PresharedKey for additional security # PresharedKey = <preshared_key> [Peer] # Client 2 PublicKey = <client_2_public_key> AllowedIPs = 10.8.0.3/32
📝 Configuration Notes:
  • Address: The VPN IP address for this interface
  • ListenPort: UDP port WireGuard listens on (default: 51820)
  • SaveConfig: Automatically save runtime configuration
  • AllowedIPs: IP ranges that can be routed through this peer
5 🌐 Enable IP Forwarding (Server Only)

For server/gateway setups, permanently enable IP forwarding:

sudo nano /etc/sysctl.conf

Uncomment or add this line:

net.ipv4.ip_forward=1

Apply the changes:

sudo sysctl -p
6 🎮 Manage WireGuard

Start WireGuard:

sudo wg-quick up wg0

Stop WireGuard:

sudo wg-quick down wg0

Enable on Boot:

sudo systemctl enable wg-quick@wg0

Disable Autostart:

sudo systemctl disable wg-quick@wg0

Check Status:

sudo systemctl status wg-quick@wg0
sudo wg show

Restart After Config Changes:

sudo wg-quick down wg0 && sudo wg-quick up wg0
7 🔥 Configure Firewall

If using UFW (Ubuntu's default firewall), allow WireGuard port:

sudo ufw allow 51820/udp

Allow forwarding (if acting as server):

sudo nano /etc/ufw/before.rules

Add these lines at the beginning (after the header comments):

# NAT table rules *nat :POSTROUTING ACCEPT [0:0] -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE COMMIT

Also edit UFW's sysctl settings:

sudo nano /etc/ufw/sysctl.conf

Ensure this line is uncommented:

net/ipv4/ip_forward=1

Reload UFW:

sudo ufw reload
🔧 Troubleshooting

Check Logs:

sudo journalctl -xe | grep wireguard

Verify Interface:

ip a show wg0

Test Connectivity:

ping 10.8.0.1

Check Active Connections:

sudo wg show wg0 latest-handshakes

✅ Quick Command Reference

🚀 Start/Stop
wg-quick up wg0
wg-quick down wg0
💾 Auto-start
systemctl enable wg-quick@wg0
systemctl disable wg-quick@wg0
📊 Monitor
wg show
systemctl status wg-quick@wg0
⚙️ Configure
nano /etc/wireguard/wg0.conf
wg-quick down wg0 && wg-quick up wg0
🎉 Setup Complete! Your WireGuard VPN is now configured. Remember to:
  • Keep your private keys secure
  • Regularly update your system
  • Monitor connection logs for unusual activity
  • Document your peer configurations

2025 m. rugsėjo 5 d., penktadienis

AI stuff

https://github.com/upstash/context7  - Naujojamas patikrinti naujausias bibliotekas

 https://www.youtube.com/watch?v=xOO8Wt_i72s&ab_channel=PatrickEllis
 - claude mcp

 

https://github.com/microsoft/playwright-mcp
playwright install 
npx playwright install  install chrome 

 

 

Chrome AI:

https://github.com/GoogleChrome/chrome-extensions-samples
chrome://on-device-internals/

https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world

 

 https://googlechromeai2025.devpost.com/resources

 

 https://groups.google.com/u/1/a/chromium.org/g/chrome-ai-dev-preview/c/4Xeuq3Px9HA

https://developer.chrome.com/origintrials/#/trials/active 

 

 Model data; chrome://on-device-internals/

 

Step 1: Force Download via Components Page

This is the most reliable method:

  1. Go to: chrome://components/
  2. Find: "Optimization Guide On Device Model"
  3. Click: "Check for update" button
  4. Wait for it to download (you'll see the version number update)
  5.  

 

  1. Monitor the download:
    • Open a new tab: chrome://on-device-internals
    • Go to the "Model Status" tab
    • You should see Gemini Nano downloading
  2. Wait 5-15 minutes for download to complete
  3. Verify it's ready:
await LanguageModel.availability();  // Should return 'available'
 
const session = await LanguageModel.create({ outputLanguage: 'lt' });
const result = await session.prompt('Parasyk haiku apie kodavimą');
console.log(result); 

2025 m. rugpjūčio 15 d., penktadienis

2025 m. gegužės 6 d., antradienis

Visual studio code regex search

If we want to find meniu, that has has some particular text

For example

<openign tag
some text
name="anchor"

 
It requires shift+Enter at the end to work

<menuitem\b[\s\S]*?\bname="My Timesheets[^"]*"

<menuitem\b[\s\S]*?\bgroups="group_hr_timesheet[^"]*"

<menuitem\b[\s\S]*?\bname="Timesheets[^"]*"

2025 m. balandžio 2 d., trečiadienis

Android sdcard restore

For some reason sometimes sdcard stops working, one way to restore it is to load card on windows and run from src.


chkdsk X: /x /r

X - Disk Drive Letter

 

 

2025 m. vasario 13 d., ketvirtadienis

Learning courses and Notes

How We Learn


Introduction to the Focused and Diffuse Modes



Diffuse (as opposed to the focused) mode of thinking:

The diffuse mode could be thought of as a flashlight set so that it casts its light very broadly, but not very strongly in any one area. (As opposed to the focused mode, which would have its light cast very strongly in a single area, but very weakly everywhere else.)
The type of thinking you need to do when you are trying to understand something new.
 
When you learn something new, many new synapses (connections) are formed on the dendrites of neurons. This formation of new synapses is one of the brain's ways to adapt and store new information, reflecting the dynamic nature of neural connectivity.

A Procrastination

Key Concepts on Procrastination

  1. Universal but Variable: Everyone procrastinates to some degree because focusing on one task means not working on many others. However, some people struggle with it more than others.
  2. Neurological Basis:
    • When confronting unpleasant tasks, the brain's pain centers activate
    • The brain naturally tries to avoid this discomfort by switching attention
    • Research shows this discomfort actually disappears shortly after beginning the task
  3. Procrastination Cycle:
    • Cue → Discomfort → Attention shift → Temporary relief
    • This reinforces the avoidance behavior
  4. The Pomodoro Technique:
    • Simple method: 25 minutes of focused work followed by a short break
    • Steps: Set timer, eliminate distractions, focus completely, reward yourself after



Hugging Face AI Agents Course

 

 Unit 1 -  Introduction to Agents

Note that Actions are not the same as Tools. An Action, for instance, can involve the use of multiple Tools to complete. 

Agent is a system that uses an AI Model (typically a LLM) as its core reasoning engine, to:

  • Understand natural language: Interpret and respond to human instructions in a meaningful way.

  • Reason and plan: Analyze information, make decisions, and devise strategies to solve problems.

  • Interact with its environment: Gather information, take actions, and observe the results of those actions.

Chat-Templates

As mentioned, chat templates are essential for structuring conversations between language models and users. They guide how message exchanges are formatted into a single prompt.


Base Models vs. Instruct Models

Another point we need to understand is the difference between a Base Model vs. an Instruct Model:

  • A Base Model is trained on raw text data to predict the next token.

  • An Instruct Model is fine-tuned specifically to follow instructions and engage in conversations. For example, SmolLM2-135M is a base model, while SmolLM2-135M-Instruct is its instruction-tuned variant.

The Core Components

Agents work in a continuous cycle of: thinking (Thought) → acting (Act) and observing (Observe).

Let’s break down these actions together:

  1. Thought: The LLM part of the Agent decides what the next step should be.
  2. Action: The agent takes an action, by calling the tools with the associated arguments.
  3. Observation: The model reflects on the response from the tool.

The Core Components

Agents work in a continuous cycle of: thinking (Thought) → acting (Act) and observing (Observe).

Let’s break down these actions together:

  1. Thought: The LLM part of the Agent decides what the next step should be.
  2. Action: The agent takes an action, by calling the tools with the associated arguments.
  3. Observation: The model reflects on the response from the tool.

 

Actions are the concrete steps an AI agent takes to interact with its environment.

Actions bridge an agent’s internal reasoning and its real-world interactions by executing clear, structured tasks—whether through JSON, code, or function calls.

 

Observations are how an Agent perceives the consequences of its actions.

 

In the observation phase, the agent:

  • Collects Feedback: Receives data or confirmation that its action was successful (or not).
  • Appends Results: Integrates the new information into its existing context, effectively updating its memory.
  • Adapts its Strategy: Uses this updated context to refine subsequent thoughts and actions.

 

Unit 2 -  Introduction to Agentic Frameworks

 

When to Use an Agentic Framework

You're right that agentic frameworks aren't always necessary for LLM applications. Here's a more detailed breakdown:

Simple Use Cases (No Framework Needed)

  • Direct question-answering
  • Content generation with fixed inputs
  • Straightforward classification tasks
  • Single-turn interactions

In these cases, a simple prompt template and direct API call to an LLM is often sufficient. The overhead of an agentic framework might be unnecessary.

Complex Use Cases (Framework Beneficial)

  • Multi-step reasoning processes
  • Tasks requiring external tool usage
  • Iterative problem-solving
  • Autonomous decision-making based on dynamic contexts
  • Systems requiring persistent memory across interactions

Framework Comparisons

Each framework you mentioned has different strengths:

  • SmolaAgents: Lightweight, minimal abstractions, good for educational purposes
  • LlamaIndex: Strong data connection capabilities, retrieval-focused
  • LangGraph: Combines LLMs with state machines, enabling complex workflows

 

Smolagents

Gallery

smolagents is a simple yet powerful framework for building AI agents. It provides LLMs with the agency to interact with the real world, such as searching or generating images.

 

1️⃣ Why Use smolagents

  • smolagents is an open-source agent framework, similar to LlamaIndex and LangGraph.
  • It has specific advantages and drawbacks, making it suitable for certain use cases.
  • Choosing the right framework depends on project requirements.

2️⃣ CodeAgents

  • Primary agent type in smolagents.
  • Generates Python code instead of JSON or text.
  • Used for performing automated actions with executable scripts.

3️⃣ ToolCallingAgents

  • Second type of agent in smolagents.
  • Generates JSON/text that the system must interpret to execute actions.
  • Key differences from CodeAgents and use cases are explored.

4️⃣ Tools

  • Tools are functions that an LLM can use in an agentic system.
  • They are essential for defining agent behavior.
  • Implementation methods include the Tool class and @tool decorator.
  • Includes how to create, share, and load tools.

5️⃣ Retrieval Agents

  • Used for searching, synthesizing, and retrieving information.
  • Leverage vector stores and RAG (Retrieval-Augmented Generation) patterns.
  • Useful for integrating web search and knowledge bases while maintaining context.

6️⃣ Multi-Agent Systems

  • Combining multiple agents enhances functionality and efficiency.
  • Example: A web search agent working alongside a code execution agent.
  • Focuses on designing, implementing, and managing multi-agent workflows.

7️⃣ Vision and Browser Agents

  • Vision agents use Vision-Language Models (VLMs) for image-based reasoning.
  • Can analyze visual data and enable multimodal interactions.
  • Browser agents can extract information from the web using vision capabilities.

 

Introduction to Tool Calling Agents

Tool Calling Agents represent the second type of agent available in the smolagents library. Unlike Code Agents that execute Python snippets, these agents leverage the built-in tool-calling capabilities of LLM providers to generate tool calls as structured JSON objects. This approach has become the standard method used by major AI providers including OpenAI, Anthropic, and many others.

Code Agents vs. Tool Calling Agents: A Comparison

To understand the difference, let's examine how each agent type would handle a request to search for catering services and party ideas:

Default Toolbox:

  • PythonInterpreterTool
  • FinalAnswerTool
  • UserInputTool
  • DuckDuckGoSearchTool
  • GoogleSearchTool
  • VisitWebpageTool

 

RAG

I've reviewed the material you shared about Agentic RAG (Retrieval-Augmented Generation) systems. Here are the key ideas to understand:

  1. Traditional RAG vs. Agentic RAG:
    • Traditional RAG simply passes a user query to search and uses retrieved results with the query for model response
    • Agentic RAG adds autonomous control over both retrieval and generation processes
  2. Key limitations of traditional RAG:
    • Relies on a single retrieval step
    • Only focuses on direct semantic similarity to the query
    • May miss relevant information
  3. Agentic RAG advantages:
    • Autonomous formulation of search queries
    • Ability to critique retrieved results
    • Multiple retrieval steps for more comprehensive outputs
  4. Core components shown in the examples:
    • Search tools (like DuckDuckGo integration)
    • Custom knowledge bases (using vector databases)
    • Document splitting for more efficient retrieval
    • BM25 retrieval for semantic search
  5. Enhanced retrieval strategies:
    • Query reformulation: crafting optimized search terms
    • Multi-step retrieval: using initial results to inform subsequent queries
    • Source integration: combining information from multiple sources
    • Result validation: analyzing content for relevance before inclusion
  6. Implementation considerations:
    • Tool selection based on query type and context
    • Memory systems to maintain conversation history
    • Fallback strategies when primary retrieval methods fail
    • Validation steps for accuracy and relevance

 

 

Links:

 
Going deeper:
 
 
Langsmith - The guy used from co-working space