# "Hello World" for Apache Kafka

First, [install the WarpStream Agent](https://docs.warpstream.com/warpstream/getting-started/install-the-warpstream-agent) for your platform.

### Running the WarpStream Agent

```shell
warpstream playground
```

The `playground` command will start an Agent on `localhost`, store all the data for the Agent in memory, and sign up for a temporary account for you to play around with.

### Create a Topic

Let's create a topic using the Apache Kafka client built-in to the WarpStream Agent. We're going to assume in this tutorial you're running the Agent as specified above on localhost, so we'll omit the arguments to specify the Kafka bootstrap URL. Open a second terminal and issue the following command:

```
warpstream kcmd --type create-topic --topic helloworld2
```

If you don't receive an error back, your request to create the topic succeeded.

### Add Records To The Topic

Now let's write a record to the topic. The `kcmd` tool writes records with a constant key of "hello", and we'll write two records with the payload of "`world`" as our example (`,,` ) is the delimiter).

<pre><code><strong>warpstream kcmd --type produce --topic helloworld2 --records "world,,world"
</strong></code></pre>

You should receive output in your terminal that looks something like this:

```
result: partition:0 offset:0 value:"world" 
result: partition:0 offset:1 value:"world" 
```

### Read Records From The Topic

```
warpstream kcmd --type fetch --topic helloworld2 --offset 0
```

Now you should see your records you wrote previously printed to the console. The key is always "hello" and the value field is the same "world" string we wrote before. You can repeat the process of writing another record and running `kcmd --type fetch` again to read and write more records.

```
result: partition:0 offset:0 key:"hello" value:"world"
result: partition:0 offset:1 key:"hello" value:"world"
```

**And that's it!** You've successfully set up a WarpStream Agent Pool to power your Virtual Cluster, created a topic, and processed some data through it.

You can now move on to trying to create a real application which reads or writes from the topic, or connect your existing tools like Flink to WarpStream.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.warpstream.com/warpstream/getting-started/hello-world-using-kafka.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
