Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release workflow for the go-sdk.
#
# go-sdk is a library, not a binary for a Go module the git tag *is* the
# go-sdk is a library, not a binary - for a Go module the git tag *is* the
# release (consumers fetch source via `go get`). This workflow therefore does
# not build or publish artifacts; it only creates a GitHub Release with
# auto-generated notes for the tag created by tag-release.yml.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ lint: vet fmt-check
@if command -v golangci-lint > /dev/null 2>&1; then \
golangci-lint run $(PACKAGES); \
else \
echo "golangci-lint not installed skipping (run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)"; \
echo "golangci-lint not installed - skipping (run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)"; \
fi

tidy:
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
[![ChatBotKit](https://img.shields.io/badge/credits-ChatBotKit-blue.svg)](https://chatbotkit.com)
[![CBK.AI](https://img.shields.io/badge/credits-CBK.AI-blue.svg)](https://cbk.ai)
[![Email](https://img.shields.io/badge/Email-Support-blue?logo=mail.ru)](mailto:support@chatbotkit.com)
[![Discord](https://img.shields.io/badge/Discord-Support-blue?logo=discord)](https://go.cbk.ai/discord)
[![Go Reference](https://pkg.go.dev/badge/github.com/chatbotkit/go-sdk.svg)](https://pkg.go.dev/github.com/chatbotkit/go-sdk)
[![Follow on Twitter](https://img.shields.io/twitter/follow/chatbotkit.svg?logo=twitter)](https://twitter.com/chatbotkit)

```text
.d8888b. 888888b. 888 d8P
d88P Y88b 888 "88b 888 d8P
888 888 888 .88P 888 d8P
888 8888888K. 888d88K
888 888 "Y88b 8888888b
888 888 888 888 888 Y88b
Y88b d88P 888 d88P 888 Y88b
"Y8888P" 8888888P" 888 Y88b .ai
```

# ChatBotKit Go SDK

The official Go SDK for [ChatBotKit](https://chatbotkit.com) - a platform for building and deploying conversational AI applications.
The official Go SDK for [ChatBotKit](https://chatbotkit.com) - a platform for
building and deploying conversational AI applications. With ChatBotKit you can
create bots and agents with custom data, skillsets, and integrations while
keeping AI orchestration on the ChatBotKit platform.

## Why ChatBotKit?

**Build lighter, future-proof AI agents.** When you build with ChatBotKit, the heavy lifting happens on our servers-not in your application. This architectural advantage delivers:
**Build lighter, future-proof AI agents.** When you build with ChatBotKit, the heavy lifting happens on our servers, not in your application. This architectural advantage delivers:

- 🪶 **Lightweight Agents**: Your agents stay lean because complex AI processing, model orchestration, and tool execution happen server-side. Less code in your app means faster load times and simpler maintenance.

- 🛡️ **Robust & Streamlined**: Server-side processing provides a more reliable experience with built-in error handling, automatic retries, and consistent behavior across all platforms.

- 🔄 **Backward & Forward Compatible**: As AI technology evolves-new models, new capabilities, new paradigms-your agents automatically benefit. No code changes required on your end.
- 🔄 **Backward & Forward Compatible**: As AI technology evolves with new models, new capabilities, and new paradigms, your agents automatically benefit. No code changes required on your end.

- 🔮 **Future-Proof**: Agents you build today will remain capable tomorrow. When we add support for new AI models or capabilities, your existing agents gain those powers without any updates to your codebase.

Expand Down Expand Up @@ -575,10 +596,10 @@ if err != nil {

## Releasing

Versions are published as Git tags for a Go module, the tag _is_ the release.
Versions are published as Git tags - for a Go module, the tag _is_ the release.
The version is driven by the [`VERSION`](VERSION) file:

1. Bump `VERSION` (semver, no `v` prefix e.g. `0.2.0`) in a pull request.
1. Bump `VERSION` (semver, no `v` prefix - e.g. `0.2.0`) in a pull request.
2. Merge to `main`. The `Tag Release` workflow reads `VERSION` and, if the
matching `vX.Y.Z` tag does not yet exist, creates and pushes it, then
triggers the `Release` workflow to publish GitHub release notes.
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ tools := agent.Tools{
An autonomous agent that ships with skill definitions baked into the binary using Go's `embed` package:

- Embeds a `skills/` directory at compile time with `//go:embed`
- Loads skills from `embed.FS` via `agent.LoadSkillsFromFS` no temp-directory extraction needed
- Loads skills from `embed.FS` via `agent.LoadSkillsFromFS` - no temp-directory extraction needed
- Bundles skills as a feature passed to `agent.ExecuteWithTools`
- Produces a single self-contained executable with no external skill files

Expand Down
14 changes: 7 additions & 7 deletions examples/agent-with-embedded-skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Demonstrates bundling skill definitions directly into the executable using Go's

## Skills bundled in this example

| Skill | Description |
| --- | --- |
| Skill | Description |
| ------------- | ------------------------------------------------------------------ |
| `Code Review` | Reviews code snippets for correctness, style, and potential issues |
| `Summarize` | Condenses long text into a concise summary |
| `Summarize` | Condenses long text into a concise summary |

Add more skills by creating a new subdirectory under `skills/` with a `SKILL.md` file they are picked up automatically at compile time.
Add more skills by creating a new subdirectory under `skills/` with a `SKILL.md` file - they are picked up automatically at compile time.

## Usage

Expand All @@ -34,8 +34,8 @@ go run .

```
Loaded 2 embedded skill(s):
• Code Review Reviews code snippets for correctness, style, and potential issues...
• Summarize Condenses long text into a concise summary, preserving key points...
• Code Review - Reviews code snippets for correctness, style, and potential issues...
• Summarize - Condenses long text into a concise summary, preserving key points...

Task: Summarize the following text in bullet style: ...

Expand Down Expand Up @@ -86,4 +86,4 @@ Extended documentation...

## Difference from `agent.LoadSkills`

`LoadSkills` reads from OS directories at runtime and sets `SkillDefinition.Path` to an absolute filesystem path. `LoadSkillsFromFS` accepts any `fs.FS` including `embed.FS` and sets `Path` to the FS-relative directory name (e.g. `"code-review"`). The rest of the API is identical.
`LoadSkills` reads from OS directories at runtime and sets `SkillDefinition.Path` to an absolute filesystem path. `LoadSkillsFromFS` accepts any `fs.FS` - including `embed.FS` - and sets `Path` to the FS-relative directory name (e.g. `"code-review"`). The rest of the API is identical.
4 changes: 2 additions & 2 deletions examples/agent-with-embedded-skills/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// ships as a single self-contained executable with no external skill files.
//
// The skills/ directory is embedded at compile time. At startup the embedded
// FS is passed directly to agent.LoadSkillsFromFS no temp-directory
// FS is passed directly to agent.LoadSkillsFromFS - no temp-directory
// extraction required.
//
// Usage:
Expand Down Expand Up @@ -78,7 +78,7 @@ fast compilation.`
skills := skillsResult.GetSkills()
fmt.Printf("Loaded %d embedded skill(s):\n", len(skills))
for _, s := range skills {
fmt.Printf(" • %s %s\n", s.Name, s.Description)
fmt.Printf(" • %s - %s\n", s.Name, s.Description)
}
fmt.Println()

Expand Down
2 changes: 1 addition & 1 deletion examples/chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ChatBot ready! Type your message and press Enter. Type 'exit' to quit.

user: Hello! What can you do?
bot: Hello! I'm an AI assistant powered by ChatBotKit. I can help you with a
variety of tasks answering questions, explaining concepts, writing, brainstorming,
variety of tasks - answering questions, explaining concepts, writing, brainstorming,
and much more. What would you like to discuss?

user: Tell me a short joke
Expand Down
14 changes: 7 additions & 7 deletions examples/stateful-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Demonstrates the same manually-driven `agent.CompleteWithTools` loop as the stat

## When to use this pattern

| Use case | Why |
| --- | --- |
| Persisted history | The server stores every message; no local slice to maintain |
| Remote orchestration | Resume a long-running conversation by ID from any process |
| Recovery | Restart without reconstructing a local message array |
| Inspection | Query the final conversation state via the API after the loop |
| Use case | Why |
| -------------------- | ------------------------------------------------------------- |
| Persisted history | The server stores every message; no local slice to maintain |
| Remote orchestration | Resume a long-running conversation by ID from any process |
| Recovery | Restart without reconstructing a local message array |
| Inspection | Query the final conversation state via the API after the loop |

## Usage

Expand Down Expand Up @@ -51,7 +51,7 @@ Bot: The weather in San Francisco is sunny at 72°F...

## Key difference from the stateless example

The stateless example appends `MessageAgentEvent` entries to a local `[]agent.Message` slice. Here, that slice is replaced by a server-side conversation the only state the loop tracks locally is the conversation ID and whether to send `Text` on the next call:
The stateless example appends `MessageAgentEvent` entries to a local `[]agent.Message` slice. Here, that slice is replaced by a server-side conversation - the only state the loop tracks locally is the conversation ID and whether to send `Text` on the next call:

```go
nextText := &userPrompt // send prompt on first iteration
Expand Down
41 changes: 21 additions & 20 deletions types/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading