How Non‑AI Developers Can Build LLM Apps: Prompt Engineering, RAG, and Function Calling Explained

This guide shows non‑AI developers how to create large‑model applications by mastering prompt engineering, multi‑turn interactions, Retrieval‑Augmented Generation, function calling, and AI‑Agent integration, with practical code examples, tool design patterns, and deployment tips.

Tencent Technical Engineering
Tencent Technical Engineering
Tencent Technical Engineering
How Non‑AI Developers Can Build LLM Apps: Prompt Engineering, RAG, and Function Calling Explained

Why Large Language Models Matter for All Developers

Large language models (LLMs) have reshaped programming by offering powerful assistants, but many developers fear being replaced. The article argues that you don’t need deep AI theory—just the ability to integrate LLMs into business logic, similar to ordinary backend development.

Getting Started Without AI Background

Even developers with no AI or math background can build LLM‑powered applications. The key is to treat the LLM as an external service that you query and orchestrate, focusing on prompt design, data flow, and tool integration.

Simple LLM Application: Web‑Search Augmented Chat

A minimal example shows an LLM that can answer questions by first searching the web. The workflow consists of two rounds:

Send the user query to the LLM. The model decides whether a search is needed and returns a list of keywords.

The application calls a search API with those keywords, feeds the results back to the LLM, and receives the final answer.

Code snippets illustrate the interaction:

func AddScore(uid string, score int) {
    // first interaction
    user := userService.GetUserInfo(uid)
    // business logic
    newScore := user.score + score
    // second interaction
    userService.UpdateScore(uid, score)
}

Prompt examples demonstrate zero‑shot and few‑shot techniques for forcing JSON output:

帮我把下面一句话的主语谓语宾语提取出来
要求以这样的json输出:{"subject":"","predicate":"","object":""}
---
这段话是:我喜欢唱跳rap和打篮球

Prompt Engineering for Complex Tasks

A detailed system prompt defines the task, input types, and output schema. The article provides a full prompt that supports both search and weather queries, showing how the LLM can emit tool_calls that the application executes.

const SYSTEM_PROMPT = "..."
async function chatWithSearch(query, maxSearches = 3) {
    let response = await llm.chat({system: SYSTEM_PROMPT, message: {type: "user_query", query}})
    while (true) {
        if (!response.need_search || response.search_count >= maxSearches) return response.final_answer
        const searchResults = await search_online(response.search_keywords)
        response = await llm.chat({type: "search_result", results: searchResults})
    }
}

Function Calling

Function calling lets the LLM request the execution of registered tools (e.g., get_weather, search_web). The framework maps the LLM’s tool_calls to concrete functions, runs them, and feeds the results back, enabling truly autonomous agents.

Retrieval‑Augmented Generation (RAG)

RAG solves the LLM context‑length limitation by retrieving only the most relevant documents. The pipeline is:

Chunk raw documents into manageable pieces (paragraphs, code blocks, etc.).

Convert each chunk into a high‑dimensional embedding vector.

Store vectors in a vector database.

At query time, embed the user question, perform similarity search, and inject the top‑N relevant chunks into the prompt.

Images illustrate the flow, and example SQL‑like queries show how vector databases differ from traditional relational queries.

Knowledge Q&A and Code‑Copilot Scenarios

Both knowledge‑base chatbots and code assistants rely on the same RAG + LLM pattern, but code assistants require code‑specific embeddings and more careful chunking to preserve syntax and context.

AI Agents and the MCP Protocol

An AI Agent is an LLM that can call external tools to act in the real world. The Model Context Protocol (MCP) standardizes how agents discover and invoke capabilities, supporting both network‑based RPC and local stdio communication. This enables a plug‑and‑play ecosystem of reusable tools.

Practical Takeaways

Choose a development framework that supports function calling.

Invest in high‑quality chunking and embedding to improve RAG recall.

Build reusable MCP‑servers for common operations (shell commands, file access, internal APIs).

Iterate on prompts and tool definitions to reduce hallucinations and handle malicious inputs.

By following these steps, non‑AI developers can quickly prototype and ship valuable LLM‑powered products.

LLM overview
LLM overview
Function calling flow
Function calling flow
RAG pipeline
RAG pipeline
LLMprompt engineeringRAGvector databaseEmbeddingAI AgentFunction Calling
Tencent Technical Engineering
Written by

Tencent Technical Engineering

Official account of Tencent Technology. A platform for publishing and analyzing Tencent's technological innovations and cutting-edge developments.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.