Skip to content

Releases: rhgs/crewai-go

v0.4.0 — Staged process and AgenticLoop

Choose a tag to compare

@rhgs rhgs released this 17 Aug 20:42
Immutable release. Only release title and notes can be modified.

What's new in v0.4.0

All features are backward compatible — no breaking changes.

Staged process

Third orchestration mode: stages run in sequence, while tasks within a single stage run concurrently. The output of each stage feeds the following ones via Task.Context. Stages marked Optional continue on failure.

crew.Process = crewai.Staged
crew.Stages = []crewai.Stage{
    {Name: "collect", Tasks: []*crewai.Task{researchA, researchB}},
    {Name: "synthesize", Tasks: []*crewai.Task{write}},
}

Agentic loop

Optional Plan → Execute → Evaluate → Refine cycle. Opt-in via Agent.Loop or Task.Loop. Supports independent evaluator, pass threshold, skip-plan, and rewrite-only refine.

agent.Loop = crewai.NewAgenticLoop(
    crewai.WithMaxRefinements(3),
    crewai.WithPassThreshold(80),
)

New sentinels

  • ErrNoStages
  • ErrEvaluationFailed
  • ErrInvalidEvaluation

Examples

  • go run ./examples/staged
  • go run ./examples/agentic_loop (offline, mock LLM)

Docs

See CHANGELOG and the bilingual README / docs.

Full changelog: https://github.com/rhgs/crewai-go/blob/v0.4.0/CHANGELOG.md

v0.3.0 — Native tool calling, Web search, slog migration

Choose a tag to compare

@rhgs rhgs released this 17 Aug 16:54
Immutable release. Only release title and notes can be modified.

What's new in v0.3.0

Native tool calling

Agent.ToolMode ("react" | "native") selects between the existing text-based ReAct loop and native function calling via the new ToolCallingLLM interface. Implemented for Ollama, OpenAI, Anthropic, and Mock.

  • ToolSpec, ToolCall, ToolCallResponse, ToolTrace types
  • ToolCallingLLM.CallWithTools(ctx, messages, toolSpecs) — provider-native tool dispatch
  • Security limits: max args/output/response bytes, JSON depth, arg validation
  • ToolTraces in TaskOutput for observability

Web search — agent-driven

WebSearcher interface + SearchWeb(ctx, llm, query, max) helper for direct web search from Go code. Implemented by:

  • OllamaPOST /api/web_search (pure search, no model invocation)
  • OpenAIweb_search_options with search-capable models
  • Anthropicweb_search_20250305 server tool
  • xAI — delegates to OpenAI-compatible client

Web search — model-driven

tools.WebSearchTool implements Tool + FactSource for the ReAct loop with pluggable SearchProvider:

Provider API key Free tier
Wikipedia 100% free (default)
LangSearch 100% free
Serpstack 1000/month free
DuckDuckGo Optional, may be blocked
Google CSE ✅ + CSE ID Paid
Brave Paid

SSRF protection: blocks non-http(s) schemes, loopback, private, link-local, and unspecified IPs. DNS rebinding prevention via net.LookupIP (fail-closed).

Logging migration to log/slog (#15)

Replaces the custom Logger interface with *slog.Logger from the standard library.

  • Crew.WithLogger(*slog.Logger) *Crew and Agent.WithLogger(*slog.Logger) *Agent — fluent setters
  • defaultLogger(verbose) — text handler on stderr, LevelDebug when Verbose=true, LevelError when Verbose=false (matches legacy "silent unless verbose")
  • All log calls use InfoContext/DebugContext/WarnContext with structured key-value pairs
  • Verbose field preserved for backward compatibility
  • Subpackages (llm/*, tools/*) remain logging-free

Security

  • Secret redaction in logs (redact.go): provider errors logged via WarnContext pass through redactError, which masks:
    • Long alphanumeric tokens (≥20 chars), preserving first/last 4 when ≥24
    • Bearer <token> in HTTP-style messages
    • api_key=/token=/key=/secret= query-string values
  • Logging safety docs: README + doc.go warn about Debug-level logs containing full LLM output
  • WithLogger thread-safety: documented as not concurrent-safe; idempotent (last wins)

Examples

  • examples/logging/ — custom *slog.Logger with redaction wrapper
  • examples/native_tools/ — native function calling demonstration

Stats

  • 70 files changed, +9,208 / -99 lines (vs v0.2.0)
  • Zero external dependencies (stdlib only)
  • Test coverage: 96.3% (root package)
  • All packages pass under -race

Full changelog: CHANGELOG.md

v0.2.0 — Structured Output, Guardrails, Facts & Provenance

Choose a tag to compare

@rhgs rhgs released this 07 Aug 17:00
Immutable release. Only release title and notes can be modified.
fcb59cb

What's New

All features are backward compatible — no breaking changes.

Structured Output

Task.Structured (*StructuredOutput) requires the model to produce JSON validated against a JSON Schema, with a bounded repair loop (RepairMax, default 2). New sentinels ErrInvalidOutput and ErrRepairBudgetExceeded. Minimal in-house schema validator (type, properties, required, enum, items) — stdlib only, no new dependencies.

Guardrails

Crew-level (Crew.Guardrails) and task-level (Task.Guardrail) post-output validation hooks that block publication of outputs violating business invariants. New sentinel ErrBlockedByGuardrail. Functional options WithGuardrails (crew) and WithGuardrail (task). Complements structured-output schema validation (shape vs. meaning).

Facts & Provenance

First-class Fact type populated only by FactSource tools, never by the LLM. Facts carry source org, source URL, collection time, and payload hash (SHA-256). NewFactSourceTool constructor, AllFactsProvenanced helper for guardrails, dedupFacts by PayloadHash. CrewOutput.Facts and TaskOutput.Facts.

Other

  • gofmt applied to all Go files (CI now enforces formatting).

Full Changelog: v0.1.0...v0.2.0

v0.1.0 — crewai-go: idiomatic Go port of CrewAI core

Choose a tag to compare

@rhgs rhgs released this 04 Aug 20:45
Immutable release. Only release title and notes can be modified.

First public release — an idiomatic Go port of the CrewAI framework core. Zero external dependencies (stdlib only).

🌐 Docs in English (default) and Português · CHANGELOG / CHANGELOG.pt-BR.md

✨ Added

  • Core orchestration: Agent, Task, Crew, Process, Tool, Memory, and a text-based ReAct executor.
  • Processes: Sequential (default) and Hierarchical (manager-driven delegation via ManagerLLM / ManagerAgent).
  • Context & interpolation: chain task outputs with WithContext; inject {key} variables through Crew.Kickoff.
  • LLM providers (stdlib only, no external deps):
    • OpenAI and compatible endpoints (Groq, Azure, Ollama /v1, …) — llm/openai
    • Anthropic (Claude) — llm/anthropic
    • Ollama local + Ollama Cloud — llm/ollama
    • xAI (Grok) via API key or subscription OAuth (Device Flow RFC 8628 + PKCE + refresh + persistence) — llm/xai
    • Deterministic mock for tests — llm/mock
  • Built-in tools: Calculator (safe recursive-descent parser), CurrentTime, WordCounttools package.
  • Memory: concurrency-safe in-process memory with substring search.
  • Docs & examples: English README + 7 guides; Portuguese mirrors (docs/pt-BR/); 7 runnable examples; hermetic tests (~90% core coverage).

🔒 Security

  • Secrets never committed; .gitignore protects .claude/, .env, *token.json.
  • xAI OAuth token persisted with 0600 permissions.

📦 Install

go get github.com/rhgs/crewai-go@v0.1.0

📝 Notes

  • License: MIT
  • Known limitations of this version: simplified hierarchical delegation (no runtime inter-agent calls), no streaming, in-process memory only, no native function calling. See PLAN.md for the full roadmap.

Primeira release pública — um port idiomático do núcleo do framework CrewAI para Go. Zero dependências externas (apenas stdlib).