DEV Community

jidong
jidong

Posted on

Building Real Apps With the Claude API — Tool Use, RAG, and Agent Patterns Explained

Calling the Claude API is easy. Put a prompt in messages.create, get an answer back.

But that alone doesn’t make a product.

To build a real app, you need three more things: Tool Use, RAG, and Agent/Workflow patterns.

Tool Use — Giving Claude Hands

Base Claude only generates text. Tool Use lets it call external functions.

[
  {
    "name": "get_apartment_price",
    "description": "Look up apartment prices for a district",
    "input_schema": {
      "type": "object",
      "properties": {
        "district": {"type": "string"},
        "year": {"type": "integer"}
      },
      "required": ["district"]
    }
  }
]
Enter fullscreen mode Exit fullscreen mode

Flow:
user question → Claude picks tools → your code executes → return tool_result → Claude writes final response.

RAG — Making Claude Know What It Doesn’t

RAG (Retrieval-Augmented Generation) injects external data into prompts.

Pipeline:

  1. Chunking
  2. Embedding
  3. Retrieval (BM25 + vector search)
  4. Re-ranking
  5. Context injection

This turns vague model output into data-grounded answers.

Agents and Workflows — Chaining Multiple Steps

Three workflow patterns:

  • Parallelization: run independent tasks at the same time
  • Chaining: one step’s output feeds the next
  • Routing: classify inputs and send them to specialized paths

The practical distinction:

  • Workflows are predictable and stable.
  • Agents are flexible but less predictable.

Start with Workflows. Add Agent behavior after guardrails are in place.

How This Becomes a Real App

For a resume analysis service, run technical skills, career trajectory, and culture-fit checks in parallel.

For a fortune-telling app (saju), connect deterministic calendar/element tools, retrieve interpretation knowledge via RAG, then chain base analysis → detailed interpretation → recommendations.

For real estate analysis, combine price APIs (Tool Use), policy/news retrieval (RAG), and parallel analysis pipelines.

The API call is just the beginning. Tool Use gives it hands. RAG gives it memory. Workflows give it a brain.

Top comments (0)