Local ai agents

From microsoft/ai-agents-for-beginners · View interactive version

Local ai agents is an AI agent skill from the GitHub repository microsoft/ai-agents-for-beginners. Build local-first AI agents wey dey run fully for developer workstation wit Microsoft Foundry Local and Qwen function-calling models. E cover Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG wit Chroma, local MCP servers, hybrid cloud/local routing

How to use this skill

Skill file

How to Create Local AI Agents wit Foundry Local and Qwen

Skill wey go help for Lesson 17 – Creating Local AI Agents.

Use am to help person wey dey learn build agent wey sabi reason, dey call tools, and dey search

documentation all na inside dem machine — no cloud inference. Make every

recommendation stand gidigba for lesson content and the runnable notebook.

Triggers

Activate this skill when person wey dey learn want:

Core mental model

Small Language Model (SLM) dey trade wide knowledge for privacy, cost, and offline work. The best

way: make the SLM dey organize and make tools carry the heavy work. The

model no need to know the codebase — e need to know wen to call

read_file and search_docs. Dis one dey play to SLM strength (small decisions

like tool choice) and avoid hin weakness (big knowledge, long multi-hop

reasoning).

Why these specific pieces

Setup essentials

foundry model run qwen2.5-7b-instruct
foundry service status
from foundry_local import FoundryLocalManager
from openai import OpenAI

manager = FoundryLocalManager("qwen2.5-7b-instruct")
client = OpenAI(base_url=manager.endpoint, api_key=manager.api_key)  # lokal plassholder

About 8 GB RAM na minimum wey make sense; GPU/NPU fit help but dem no mandatory.

Key patterns wey you fit repeat

Show the learner the notebook

CODE0:

Hybrid routing (local as one of the models)

| Situation | Where e dey run |

|-----------|---------------|

| Sensitive data / offline | Local SLM |

| Simple, bounded task | Local SLM (cheap, fast) |

| Hard multi-hop reasoning on non-sensitive data | Cloud model |

| Cloud outage | Local SLM (graceful degradation) |

Dis one dey mirror di model-routing idea from Lesson 16, with workstation as one

of di routes. Make you like designs wey fit fall back to local so agent go degrade in

quality, no be just fail completely.

Guardrails for the assistant


<!-- CO-OP TRANSLATOR DISCLAIMER START -->

Disclaimer:

Dis document don translate wit AI translation service Co-op Translator. Even tho we dey try make am correct, abeg make you know say automated translation fit get errors or mistakes. Di original document for dia own language na im be di correct source. For important info, make person wey sabi human translation do am. We no go responsible for any misunderstanding or wrong understanding wey fit happen because of dis translation.

<!-- CO-OP TRANSLATOR DISCLAIMER END -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.