Categories Games

Cara Membangun Agen AI dari Awal — Lebih Sederhana dari yang Anda Bayangkan

Ilustrasi gambar dibuat dengan AI

Panduan langkah demi langkah untuk membangun agen AI pengedit kode yang berfungsi penuh dengan Python — dari chatbot dasar hingga agen yang membaca, mencantumkan, dan mengedit file menggunakan penggunaan alat LLM

Di blog ini, kami akan membangun agen AI yang berfungsi penuh dari awal, yang dapat membaca file, membuat daftar direktori, dan bahkan mengedit kode, semuanya dalam kurang dari 400 baris kode Python.

Jika Anda pernah melihat agen AI mengedit file, menjalankan perintah, memulihkan kesalahan, dan mencoba kembali berbagai strategi, sepertinya ada keajaiban di baliknya. Tidak ada. Ini adalah LLM, satu lingkaran, dan token yang cukup. Itu saja.

Saya terinspirasi oleh postingan luar biasa Thorsten Ball di mana dia membuat agen pengeditan kode di Go. Di blog ini, saya akan memandu Anda membuat hal yang sama dengan Python langkah demi langkah menggunakan Anthropic SDK (untuk inferensi LLM). Pada akhirnya, Anda akan memiliki agen yang berfungsi yang dapat menavigasi sistem file Anda secara mandiri dan mengedit kode.

Namun sebelum mendalaminya, mari kita pahami apa sebenarnya agen AI dan cara kerja penggunaan alat.

Apa itu Agen AI?

Sebuah Agen AI hanyalah sebuah LLM dengan akses ke alat, memberikannya kemampuan untuk memodifikasi sesuatu di luar jendela konteksnya.

Itulah definisi keseluruhannya. Mari kita uraikan:

  • LLM — Otak yang berpikir dan mengambil keputusan
  • Peralatan — Fungsi yang dapat dipanggil agen untuk berinteraksi dengan dunia luar (membaca file, mencari web, mengeksekusi kode, dll.)
  • Lingkaran — Agen terus berjalan hingga tugas selesai, memanggil alat sesuai kebutuhan
Ilustrasi gambar dibuat dengan AI

Secara sederhana, anggap saja seperti ini: Anda (pengguna) memberikan tugas kepada agen. Agen memikirkannya, memutuskan bahwa ia memerlukan lebih banyak informasi, memanggil alat untuk mendapatkan informasi tersebut, memproses hasilnya, memutuskan apakah ia perlu berbuat lebih banyak, dan mengulanginya hingga tugas selesai. Itulah keseluruhan perulangannya.

Sekarang mari kita membangunnya.

Prasyarat

Inilah yang perlu Anda ikuti:

  • Python 3.10+ dipasang
  • Kunci API antropik — Dapatkan satu dari Konsol Antropik
  • Terminal dan editor teks

Instal perpustakaan yang diperlukan:

pip install anthropic

Tetapkan kunci API Anda sebagai variabel lingkungan:

export ANTHROPIC_API_KEY="your-api-key-here"

Langkah 1: Bangun Chatbot Dasar

Mari kita mulai dengan sederhana. Sebelum kita menambahkan kemampuan agen apa pun, mari kita buat chatbot terminal dasar yang dapat berkomunikasi dengan Claude.

Buat file baru bernama agent.py:

impor os
impor json
dari impor antropik Antropik

klien = Antropik()

def obrolan():
"""Loop chatbot dasar - bicara dengan Claude di terminal."""
percakapan = []

mencetak("Ngobrol dengan Claude (gunakan 'ctrl-c' untuk keluar)")

sementara Benar:
masukan_pengguna = masukan("\033[94mYou\033[0m: ")

# Add user message to conversation
conversation.append({
"role": "user",
"content": user_input
})

# Send to Claude
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=conversation
)

# Extract and print response
assistant_message = response.content[0].teks
mencetak(f"\033[93mClaude\033[0m: {assistant_message}")

# Add assistant response to conversation
conversation.append({
"role": "assistant",
"content": response.content
})

if __name__ == "__main__":
chat()
Run it:
python agent.py
Chat with Claude (use 'ctrl-c' to quit)
You: Hey! I'm Luv! How are you?
Claude: Hi Luv! I'm doing well, thanks for asking. How are you doing today?
You: What's my name?
Claude: Your name is Luv!

What’s happening here?

  1. We print a prompt and wait for user input
  2. We add the user’s message to the conversation list
  3. We send the entire conversation to Claude
  4. We print Claude’s response and add it to the conversation
  5. Repeat

Notice how Claude remembers your name from the first message. That’s because we send the entire conversation every time. The server (Anthropic’s API) is stateless — it only sees what’s in the conversation list we send. It’s up to us to maintain that context.

This is essentially every AI chat application you’ve ever used, just in the terminal. But it’s not an agent yet. Let’s change that.

What is Tool Use (Function Calling)?

Before we add tools to our agent, let’s understand the concept. The basic idea is this:

Step 1: You tell the model what tools are available (name, description, input parameters)

Step 2: When the model wants to use a tool, it responds with a special tool_use message instead of regular text

Step 3: You execute the tool locally and send the result back to the model

Step 4: The model uses that result to continue its response

In simple terms, imagine you’re talking to a friend and you tell them: “In the following conversation, wink if you want me to raise my arm.” That’s essentially what tool use is: we define signals (tools) for the model, and when it “winks” (requests a tool), we “raise our arm” (execute the function) and tell it what happened.

We can already demonstrate this concept without any code changes. Try this conversation in our basic chatbot:

You: You are a weather expert. When I ask about weather, reply with 
get_weather(<location>). I will tell you the actual weather.
Claude: Understood! I'll use get_weather(<location>) when you ask about
the weather. Ready when you are.
You: What's the weather in Mumbai?
Claude: get_weather(Mumbai)
You: Hot and humid, 32 degrees celsius
Claude: The current weather in Mumbai is hot and humid at 32°C (about 90°F).
That's fairly typical for Mumbai. Stay hydrated!

See what happened? We told Claude to “wink” with get_weather when it wants weather data. It did, we replied with the result, and Claude processed it naturally.

These models are trained and fine-tuned to use tools they’re very eager to do so. By now, in 2026, they essentially “know” that they don’t know everything and can use tools to get more information.

Now, instead of doing this manually, let’s formalize it with proper API support.

Step 2: Add the Tool Use Infrastructure

Let’s restructure our code to support tools. We’ll create an Agent class with the core agent loop:

import os
import json
from anthropic import Anthropic

client = Anthropic()

class Agent:
def __init__(self, tools=None):
self.tools = tools or []
mandiri.alat_fungsi = {}

def register_tool(diri, nama, deskripsi, skema_input, fungsi):
"""Daftarkan alat yang dapat digunakan Claude."""
self.tools.append({
"nama": nama,
"keterangan": keterangan,
"masukan_skema": masukan_skema
})
self.tool_functions[name] = fungsi

def eksekusi_alat(mandiri, nama_alat, masukan_alat):
"""Jalankan alat dan kembalikan hasilnya."""
jika nama_alat tidak ada di fungsi_alat sendiri:
kembali f"Kesalahan: Alat '{tool_name}' tidak ditemukan"

mencoba:
hasil = self.tool_functions[tool_name](masukan_alat)
hasil kembali
kecuali Pengecualian sebagai e:
kembali f"Kesalahan: {str(e)}"

def lari(diri):
"""Lingkaran agen utama."""
percakapan = []

mencetak("Ngobrol dengan Claude (gunakan 'ctrl-c' untuk keluar)")

sementara Benar:
# Dapatkan masukan pengguna
masukan_pengguna = masukan("\033[94mYou\033[0m: ")
conversation.append({
"role": "user",
"content": user_input
})

# Agent loop - keeps running until no more tool calls
while True:
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=4096,
messages=conversation,
tools=self.tools
)

# Add assistant response to conversation
conversation.append({
"role": "assistant",
"content": response.content
})

# Process response - check for tool use
tool_results = []
untuk blok di respon.konten:
jika blok.type == "teks":
mencetak(f"\033[93mClaude\033[0m: {block.text}")
elif block.type == "tool_use":
print(f"\033[92mtool\033[0m: {block.name}({json.dumps(block.input)})")
result = self.execute_tool(block.name, block.input)
tool_results.append({
"type": "tool_result",
"tool_use_id": block.id,
"content": str(result)
})

# If no tool calls, we're done - wait for next user input
if not tool_results:
break

# Send tool results back to Claude
conversation.append({
"role": "user",
"content": tool_results
})

Let’s break down the key part — the inner while True loop:

This is the heartbeat of every AI agent. Here’s what happens:

  1. Send the conversation to Claude (including tool definitions)
  2. Get the response back
  3. Check each content block in the response:
  • If it’s text → print it
  • If it’s tool_use → execute the tool and collect the result and append it to the conversation list

4. Then the same loop If there were tool calls → send results back to Claude and loop again

5. If no tool calls → Claude is done, break and wait for next user input

That’s it. This inner loop is what transforms a chatbot into an agent. The agent keeps calling tools and processing results until it decides it has enough information to give you a final answer.

Step 3: The read_file Tool

Now let’s build our first tool: read_file. This tool allows Claude to read the contents of any file in the working directory.

Each tool needs four things:

  • Name — What to call it
  • Description — Tells the model what the tool does, when to use it, when NOT to use it
  • Input schema — JSON schema describing what inputs the tool expects
  • Function — The actual implementation that runs when Claude calls it
def read_file(input_data):
"""Read the contents of a file."""
path = input_data["path"]

mencoba:
dengan terbuka(jalur, "R") sebagai f:
kembalikan f.baca()
kecuali FileNotFoundError:
kembali f"Kesalahan: File '{path}' tidak ditemukan"
kecuali Pengecualian sebagai e:
kembali f"Kesalahan saat membaca berkas: {str(e)}"

Daftarkan ke agen kami:

agent = Agent()

agent.register_tool(
name="read_file",
description="Read the contents of a given relative file path. Use this when you want to see what's inside a file. Do not use this with directory names.",
input_schema={
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path of a file in the working directory."
}
},
"required": ["path"]
},
function=read_file
)

Mari kita uji! Pertama, buat file pengujian:

echo 'What animal is the most disagreeable because it always says neigh?' > secret-file.txt

Sekarang jalankan agen:

You: Help me solve the riddle in secret-file.txt
tool: read_file({"path": "secret-file.txt"})
Claude: The answer to the riddle is: A horse! 🐴

The riddle plays on the word "neigh" which is the sound a horse
makes — sounding like "nay", meaning to disagree. So horses are
"disagreeable" because they always say "neigh/nay"!

Perhatikan sesuatu yang kuat di sini: kami tidak pernah memberi tahu Claude “Jika pengguna bertanya tentang suatu file, bacalah file tersebut.” Kami juga tidak mengatakan “jika sesuatu tampak seperti nama file, cari tahu cara membacanya.” Kami hanya mengatakan “bantu aku menyelesaikan masalah di file ini” dan Claude menemukan jawabannya sendiri bahwa ia harus membaca file untuk menjawab pertanyaan.

Inilah keajaiban penggunaan alat, Anda menentukan kemampuan, dan LLM memutuskan kapan dan bagaimana menggunakannya.

Langkah 4: Alat list_files

Setiap agen yang baik perlu mengorientasikan dirinya. Sama seperti hal pertama yang Anda lakukan di server baru adalah menjalankan ls, mari kita berikan kemampuan yang sama kepada Claude:

import os

def list_files(input_data):
"""List files and directories at a given path."""
dir_path = input_data.get("path", ".")

try:
entries = []
for item in os.listdir(dir_path):
full_path = os.path.join(dir_path, item)
if os.path.isdir(full_path):
entries.append(f"{item}/")
else:
entries.append(item)
return json.dumps(sorted(entries))
except Exception as e:
return f"Error listing files: {str(e)}"

agent.register_tool(
name="list_files",
description="List files and directories at a given path. If no path is provided, lists files in the current directory.",
input_schema={
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Optional relative path to list files from. Defaults to current directory if not provided."
}
},
"required": []
},
function=list_files
)
Now Claude can combine tools — and it does this automatically:
You: Tell me about all the Python files in here. Be brief!
tool: list_files({})
tool: read_file({"path": "agent.py"})
Claude: Here's a quick overview:

**agent.py**: Implements an AI agent that can interact with the local
filesystem. It uses the Anthropic SDK to communicate with Claude,
provides tools for reading files and listing directories, and manages
the conversation loop with tool execution.

This is a simple terminal-based chatbot with file system access.

Pertama ia mencantumkan file untuk menemukan file Python, lalu membaca masing-masing file. Sama seperti yang Anda lakukan – pertama, lalu cat file yang Anda minati.

Langkah 5: Alat edit_file — Menjadi Menyenangkan

Inilah alat yang mengubah agen kami dari pembaca menjadi editor. Penerapannya mungkin akan mengejutkan Anda dengan kesederhanaannya:

def edit_file(input_data):
"""Edit a file by replacing old_str with new_str, or create a new file."""
path = input_data["path"]
old_str = input_data.get("old_str", "")
new_str = input_data.get("new_str", "")

if old_str == new_str:
return "Error: old_str and new_str must be different"

# If file doesn't exist and old_str is empty, create new file
if not os.path.exists(path) and old_str == "":
# Create directories if needed
dir_name = os.path.dirname(path)
if dir_name:
os.makedirs(dir_name, exist_ok=True)

with open(path, "w") as f:
f.write(new_str)
return f"Successfully created file {path}"

# Read existing file
try:
with open(path, "r") as f:
content = f.read()
except FileNotFoundError:
return f"Error: File '{path}' not found"

# Replace old_str with new_str
if old_str not in content:
return "Error: old_str not found in file"

new_content = content.replace(old_str, new_str, 1) # Replace first occurrence only

with open(path, "w") as f:
f.write(new_content)

return "OK"

agent.register_tool(
name="edit_file",
description="""Make edits to a text file.

Replaces 'old_str' with 'new_str' in the given file. 'old_str' and 'new_str' MUST be different from each other.

If the file specified with path doesn't exist, it will be created.""",
input_schema={
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The path to the file"
},
"old_str": {
"type": "string",
"description": "Text to search for - must match exactly and must only have one match exactly"
},
"new_str": {
"type": "string",
"description": "Text to replace old_str with"
}
},
"required": ["path", "new_str"]
},
function=edit_file
)

Ya, penggantian taliuntuk mengedit file. Itu saja. LLM modern seperti Claude sangat pandai menghasilkan penggantian string yang tepat. Mereka membaca file, mengidentifikasi dengan tepat apa yang perlu diubah, dan mengirimkan string lama dan baru.

Sekarang mari kita lihat aksinya:

You: Create a fizzbuzz.py that prints FizzBuzz from 1 to 100
tool: edit_file({"path": "fizzbuzz.py", "old_str": "", "new_str": "def fizzbuzz(n):\n for i in range(1, n + 1):\n output = ''\n if i % 3 == 0:\n output += 'Fizz'\n if i % 5 == 0:\n output += 'Buzz'\n print(output or i)\n\nif __name__ == '__main__':\n print('Running FizzBuzz:')\n fizzbuzz(100)"})
Claude: I've created fizzbuzz.py! You can run it with:
python fizzbuzz.py

Mari kita verifikasi apakah ini berhasil:

$ python fizzbuzz.py
Running FizzBuzz:
1
2
Fizz
4
Buzz
Fizz
...
14
FizzBuzz

Sekarang mari kita memintanya suntingberkas:

You: Edit fizzbuzz.py to only print until 15
tool: read_file({"path": "fizzbuzz.py"})
tool: edit_file({"path": "fizzbuzz.py", "old_str": "fizzbuzz(100)", "new_str": "fizzbuzz(15)"})
Claude: Done! I've updated fizzbuzz.py to only print until 15.

Perhatikan alur kerjanya: Claude dulu membacafile untuk memahami isinya, lalu membuat a pengeditan yang tepatmengganti hanya bagian yang perlu diubah. Itu tidak menulis ulang seluruh file — itu menggantikan fizzbuzz(100) dengan fizzbuzz(15).

Menyatukan Semuanya

Inilah agent.py lengkapnya — kurang dari 200 baris logika aktual:

import os
import json
from anthropic import Anthropic

client = Anthropic()

# ---- Tool Implementations ----

def read_file(input_data):
"""Read the contents of a file."""
path = input_data["path"]
try:
with open(path, "r") as f:
return f.read()
except FileNotFoundError:
return f"Error: File '{path}' not found"
except Exception as e:
return f"Error reading file: {str(e)}"

def list_files(input_data):
"""List files and directories at a given path."""
dir_path = input_data.get("path", ".")
try:
entries = []
for item in os.listdir(dir_path):
full_path = os.path.join(dir_path, item)
if os.path.isdir(full_path):
entries.append(f"{item}/")
else:
entries.append(item)
return json.dumps(sorted(entries))
except Exception as e:
return f"Error listing files: {str(e)}"

def edit_file(input_data):
"""Edit a file by replacing old_str with new_str, or create a new file."""
path = input_data["path"]
old_str = input_data.get("old_str", "")
new_str = input_data.get("new_str", "")

if old_str == new_str:
return "Error: old_str and new_str must be different"

if not os.path.exists(path) and old_str == "":
dir_name = os.path.dirname(path)
if dir_name:
os.makedirs(dir_name, exist_ok=True)
with open(path, "w") as f:
f.write(new_str)
return f"Successfully created file {path}"

try:
with open(path, "r") as f:
content = f.read()
except FileNotFoundError:
return f"Error: File '{path}' not found"

if old_str and old_str not in content:
return "Error: old_str not found in file"

new_content = content.replace(old_str, new_str, 1)
with open(path, "w") as f:
f.write(new_content)
return "OK"

# ---- Tool Definitions ----

TOOLS = [
{
"name": "read_file",
"description": "Read the contents of a given relative file path. Use this when you want to see what's inside a file. Do not use this with directory names.",
"input_schema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path of a file in the working directory."
}
},
"required": ["path"]
}
},
{
"name": "list_files",
"description": "List files and directories at a given path. If no path is provided, lists files in the current directory.",
"input_schema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Optional relative path to list files from. Defaults to current directory."
}
},
"required": []
}
},
{
"name": "edit_file",
"description": "Make edits to a text file. Replaces 'old_str' with 'new_str' in the given file. If the file doesn't exist and old_str is empty, creates a new file with new_str as content.",
"input_schema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The path to the file"
},
"old_str": {
"type": "string",
"description": "Text to search for - must match exactly"
},
"new_str": {
"type": "string",
"description": "Text to replace old_str with"
}
},
"required": ["path", "new_str"]
}
}
]

TOOL_FUNCTIONS = {
"read_file": read_file,
"list_files": list_files,
"edit_file": edit_file,
}

# ---- Agent Loop ----

def run_agent():
"""Main agent loop with tool use."""
conversation = []

print("🤖 Code-Editing Agent (use 'ctrl-c' to quit)")
print("I can read, list, and edit files in this directory.\n")

while True:
user_input = input("\033[94mYou\033[0m: ")
conversation.append({"role": "user", "content": user_input})

# Inner loop: keep running until no more tool calls
while True:
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=4096,
messages=conversation,
tools=TOOLS
)

# Add response to conversation
conversation.append({
"role": "assistant",
"content": response.content
})

# Process response blocks
tool_results = []
for block in response.content:
if block.type == "text":
print(f"\033[93mClaude\033[0m: {block.text}")
elif block.type == "tool_use":
print(f"\033[92mtool\033[0m: {block.name}({json.dumps(block.input)})")

func = TOOL_FUNCTIONS.get(block.name)
if func:
result = func(block.input)
else:
result = f"Error: Unknown tool '{block.name}'"

tool_results.append({
"type": "tool_result",
"tool_use_id": block.id,
"content": str(result)
})

# If no tool calls, break inner loop
if not tool_results:
break

# Send tool results back and continue
conversation.append({"role": "user", "content": tool_results})

if __name__ == "__main__":
run_agent()

Bagaimana Hal Ini Dibandingkan dengan Agen Produksi?

Anda mungkin bertanya-tanya apakah membuat agen sesederhana itu, apa yang membuat agen produksi seperti Amp, Cursor, atau GitHub Copilot begitu mengesankan?

Loop inti persis seperti yang kami buat. Perbedaannya adalah rekayasa seputar perulangan itu:

Apa yang Kami Bangun vs Agen Produksi

Gambar dihasilkan dengan AI

Seperti yang dijelaskan dalam panduan agen OpenAI, agen produksi juga menggunakan pola orkestrasi seperti:

  • Agen tunggal dengan banyak alat— Mulai dari sini, kembangkan secara bertahap
  • Pola manajer— Satu agen pusat mengoordinasikan sub-agen khusus
  • Serah terima yang terdesentralisasi— Agen saling meneruskan tugas berdasarkan spesialisasi

Wawasan utama dari panduan mereka: “maksimalkan kemampuan agen tunggal terlebih dahulu” sebelum beralih ke arsitektur multi-agen.

Pelajaran Penting dari Membangun Agen Ini

Berikut adalah kesimpulan penting:

1. Deskripsi alat lebih penting dari yang Anda kira

Deskripsi yang Anda tulis untuk setiap alat pada dasarnya adalah sebuah petunjuk. Claude menggunakannya untuk memutuskan Kapan Dan Bagaimana untuk menggunakan alat tersebut. Tulis deskripsi yang jelas dan spesifik, sertakan apa yang dilakukan alat tersebut, masukan apa yang diharapkan, dan kapan TIDAK menggunakannya.

2. Model memutuskan kapan menggunakan alat

Kami tidak pernah menulis logika kondisional seperti “jika pengguna menyebutkan sebuah file, panggil read_file.” LLM mengetahuinya sendiri berdasarkan deskripsi alat dan maksud pengguna. Ini adalah aspek penggunaan alat yang paling kuat.

3. Jaga agar keluaran alat tetap sederhana

Kembalikan string biasa atau JSON. Semakin sederhana formatnya, semakin mudah model tersebut diproses. Kami mengembalikan “OK” untuk pengeditan yang berhasil dan pesan kesalahan untuk kegagalan, itu saja yang dibutuhkan Claude.

4. Lingkaran adalah segalanya

Perulangan while True bagian dalam yang terus memproses panggilan alat hingga tidak ada lagi yang tersisa, itulah perbedaan utama antara chatbot dan agen. Chatbot melakukan satu panggilan inferensi per giliran. Seorang agen melakukan sebanyak yang dibutuhkan.

5. Penggantian string bekerja dengan sangat baik

Anda mungkin mengira pengeditan file memerlukan penguraian AST, pengasuh pohon, atau algoritma diff yang kompleks. Tapi Claude dilatih untuk menghasilkan penggantian string yang tepat, dan itu bekerja dengan sangat baik. Ini adalah jumlah editor kode produksi yang mengimplementasikan alat editnya.

Apa Selanjutnya? Memperluas Agen Anda

Sekarang setelah Anda memiliki agen yang berfungsi, berikut beberapa ide untuk memperluasnya:

  • Tambahkan sebuah alat run_command— Biarkan Claude menjalankan perintah shell dan melihat hasilnya
  • Tambahkan sebuah alat pencarian_files— Telusuri file untuk menemukan kode yang relevan
  • Tambahkan perintah sistem— Beritahu Claude tentang proyek, standar pengkodean, dan pedoman
  • Tambahkan streaming— Gunakan API streaming Anthropic untuk keluaran waktu nyata
  • Tambahkan pagar pengaman— Konfirmasikan sebelum operasi destruktif (menghapus, menimpa)
  • Tambahkan memori— Simpan ringkasan percakapan antar sesi

Masing-masing hanyalah definisi alat + fungsi lainnya. Lingkaran agen tetap sama.

Pikiran Terakhir

Membangun agen AI bukanlah ilmu roket. Ini adalah LLM, loop, dan alat. Tiga alat yang kami buat read_file, list_files, dan edit_file sudah cukup untuk membuat agen yang dapat menavigasi basis kode Anda secara mandiri dan melakukan pengeditan yang berarti.

Wawasan sebenarnya adalah betapa sedikitnya kode yang dibutuhkan. Kurang dari 200 baris logika Python, dan Anda memiliki sesuatu yang benar-benar terasa seperti asisten cerdas yang mengedit kode Anda. Model-modelnya sangat kuat, sekarang yang mereka butuhkan hanyalah alat yang tepat dan loop yang tepat.

Jika Anda sedang membangun aplikasi AI dan belum mempelajari penggunaan alat, saya sangat menyarankan untuk memulai dengan agen sederhana ini. Setelah Anda melihatnya membaca file, memikirkannya, dan melakukan pengeditan yang tepat — semuanya dengan sendirinya, Anda akan memahami mengapa semua orang di industri ini membicarakan tentang agen.

Kaisar tidak punya pakaian. Dan itulah sebenarnya bagian yang menarik — artinya Anda dapat membangun ini juga.

Terinspirasi oleh Thorsten Ball Cara Membangun Agen. Implementasi asli di Go, disesuaikan dengan Python untuk blog ini.

Semua kode dari blog ini tersedia dan siap untuk di copy-paste. Cobalah membangun agen Anda sendiri dan lihat seberapa jauh Anda dapat mengembangkannya!


Cara Membangun Agen AI dari Awal – Lebih Sederhana Dari yang Anda Pikirkan pertama kali diterbitkan di Stackademic on Medium, tempat orang-orang melanjutkan percakapan dengan menyorot dan menanggapi cerita ini.

Berita Terkini

Berita Terbaru

Daftar Terbaru

News

Berita Terbaru

Flash News

RuangJP

Pemilu

Berita Terkini

Prediksi Bola

Togel Deposit Pulsa

Technology

Otomotif

Berita Terbaru

Slot Demo Gratis Tanpa Potongan 2025

Slot yang lagi gacor

Teknologi

Berita terkini

Berita Pemilu

Berita Teknologi

Hiburan

master Slote

Berita Terkini

Pendidikan

Resep

Jasa Backlink

One Piece Terbaru

More From Author