How to Build and Schedule Local AI Assistants for Daily Tasks

Iniciado por joomlamz, Hoje at 02:15

Respostas: 0   |   Visualizações: 5

Tópico anterior - Tópico seguinte

0 Membros e 1 Visitante estão a ver este tópico.


                     How to Build and Schedule Local AI Assistants for Daily Tasks
               




Tópico:
                     How to Build and Schedule Local AI Assistants for Daily Tasks
               
Categoria: Tutoriais | FreeCodeCamp Premium
Idioma Principal: Português (Conteúdo de Tecnologia)

Conteúdo do Tutorial / Guia Passo a Passo:
-------------------------------------------------------------------------
Most AI agents are reactive as they wait for us to ask something. In this tutorial, I'll show you how to build local AI assistants that run on a schedule, handle the tasks you care about, and generate daily digests for it. Each Assistant is an AI agent and the goal is to automate repetitive work with a cron-driven setup that saves you time.

We'll use Python to create a simple local scheduler, a directory of agents, and Ollama running the model locally so you avoid per-call API charges and keep inference on your own machine.

Table of Contents

• Background

• Motivation and architecture

• Step 1: Install Ollama and pull the model

• Step 2: Install Python dependencies

• Step 3: Define the agent format

• Step 4: Create the Agent Scheduler

• Step 5: Add three real agents

• Agent 1: GOOGL stock check

• Agent 2: AI news digest

• Agent 3: Weather brief

• Step 6: Add Agent Scheduler to cron

• MacOS and Linux

• Windows with Task Scheduler

• Sample output

• Conclusion

Background

Many of us have AI agents that can perform useful tasks – but they still need to be triggered. What if you could build a system that runs every day, automatically invokes those agents, and delivers the results without any manual effort? As an example, Claude uses the
/loopcommand to scheduling recurring tasks.

In this tutorial, we'll build a lightweight daily scheduler that does exactly that. Every day, it invokes three read-only AI agents on a schedule. The same pattern can be extended to automate virtually any recurring AI-powered workflow. The AI agent acts as your assistant to complete the task.

To follow this tutorial, you'll need Ollama installed on your machine. The example works on macOS, Windows, and Linux. I'm using a MacBook Pro with 32 GB of RAM, but you can run this on a lower-memory machine by choosing a smaller Qwen model from Ollama.

Motivation and Architecture

The motivation behind this project is simple: I want AI agent workers to handle repetitive tasks for me. Instead of doing tasks manually, I can have specialized agents do the work automatically.

Another benefit of this approach is privacy and control. Since everything runs locally, the agents, prompts, and outputs remain on my machine. There's no need to rely on external automation platforms or send workflow data to third-party services.

The architecture is intentionally lightweight. A scheduler runs once a day and invokes a set of read-only AI agents.

Each agent is responsible for a single task: checking GOOGL stock performance, summarizing the latest AI news, and generating a weather brief. The agent scheduler executes them independently, collects their outputs, and stores the results as markdown file in outputs folder. As the needs grow, we can add more agents to the folder to create additional recurring workflows. The agent scheduler code won't change.

project/
├── scheduler.py
├── outputs/
├── agents/
├── googl_stock.py
├── ai_news.py
└── weather_brief.py

Step 1: Install Ollama and Pull the Model

First, install Ollama for your platform.

We'll use Qwen for the local model.

ollama pull qwen3.5:4b

Step 2: Install Python Dependencies

Create a virtual environment and install the packages:

python3 -m venv venv
source venv/bin/activate
pip install langchain langchain-ollama requests

It requi

... [O tutorial continua no link abaixo] ...


Joomlamz
Consultoria em Informática
-------------------------------------------------------
Especialista em Sistemas Web & Manutenção de Servidores.
A desenvolver o novo AplPortal com suporte a PHP 8.
Precisa de ajuda profissional? Contacte-me.

Tags: