Skip to content
8.8. From Python

8.8. From Python

In one glance

  • You will: Translate what you know from LangGraph or the Python course into the package that owns it here.
  • You need: Working knowledge of a Python agent framework. Nothing installed.
  • Time: about 10 minutes, reference.

What transfers from LangGraph, and what Go relocates

This page is a concept map. Each idea you carry from LangGraph or the Python course — a node, a checkpointer, an interrupt, a retriever, a tracing integration — points at the package that owns it here. None is conceptually new; each moves out of a decorator or dictionary into a struct, a package, or a process boundary you can point at. That is an inconvenience while you prototype and a relief on call. Without those addresses you read the whole course for concepts you arrived with, so this page gives them, the three Python habits that do not survive the crossing, and a rule for which course to run first.

The graph is the sharpest case. There is no graph object to build and mutate; the whole conversational agent is the value one constructor returns:

func (c *Compose) conversationalConfig() llmagent.Config {
	localReads, readToolsets := c.readTools()

	cfg := c.baseConfig(AgentName, AgentDescription, c.instruction)
	cfg.Tools = concatTools(localReads, c.tools.ActionTools(), c.memory)
	cfg.Toolsets = append(readToolsets, c.skills)
	return cfg
}

// ConversationalAgent builds the default entrypoint.
func (c *Compose) ConversationalAgent() (agent.Agent, error) {
	return newAgent(c.conversationalConfig())
}

That config comes from ADK, Google’s Agent Development Kit. It holds a list of tools and one instruction bound to one model, plus a toolset, which supplies its tools per turn rather than at build time. There is no registry, no import-time discovery, and no runtime add_node. Everything it needs arrived on Compose, the dependency struct the process validates at startup, which is why a test can replace any single element with a fake and nothing process-wide changes.

Where each LangGraph concept lives in this repository

In LangGraph or PythonHereWhat actually changes
StateGraph, nodes, conditional edgesConversationalAgent, TriageWorkflow, and CoordinatorAgent in agents/go/composeThree explicit compositions rather than one mutable graph; the entrypoint picks exactly one, and a test proves it cannot pick two, so no start builds a composition it will not serve.
@tool with pydantic argumentsA handler plus a typed argument struct in agents/go/toolsADK derives the JSON declaration from the struct, so there is no second copy of the schema to drift from the code.
MemorySaver, checkpointer, thread_idThe ADK session store in agents/go/.state/runtime.db, with A2A tasks in tasks.dbA conversation and a unit of work become two objects with two lifecycles — 2.4. Sessions takes them apart.
interrupt() and human-in-the-loop resumptionADK tool confirmation plus re-validation in agents/go/tools/action.goApproval is not resumed state. Approver, session, invocation, and rationale are parsed again in the last instruction before the write.
Callbacks, middleware, guardrail chainsOne policy plugin in agents/go/policy, attached once at the app boundaryRedaction and spotlighting apply to every composition, so adding a sub-agent later cannot quietly drop them.
A vector store retrieveragents/go/memory: keyword ranking by default, cosine over SQLite blobs when AGENT_SEMANTIC_RETRIEVAL=trueThe default retriever is deterministic, so an evaluation measures the agent rather than the embedding model of the week.
LangSmith tracingOpenTelemetry from agents/go/telemetry into self-hosted Tempo, Loki, Prometheus, and GrafanaYou run the backends. Nothing leaves the machine, and no vendor is between you and a slow turn.
LangSmith datasets and evaluatorsThe standalone evals moduleIt reaches the agent only over the ADK REST or A2A wire and may not import agents/go; a check on the resolved import graph enforces it.
langgraph dev and hosted deploymentOne static distroless image, k3d, and kagentThe same digest runs on your host, on the local cluster, and in the optional cloud lab.
.env with pydantic-settingsagents/go/configParsed and validated before a runtime exists; mise run config:check prints the effective values with secrets masked.
asyncio and awaitGoroutines and context.ContextCancellation is a value you pass down, so a tool deadline genuinely cancels the query underneath it instead of abandoning it.

Three habits do not survive the crossing. There is no notebook: the fast loop is mise run test, which calls no model and starts no service. Test doubles are interfaces you pass in rather than attributes you patch at runtime, so you swap a dependency by handing the composition a different value. And no dependency arrives at runtime: the image is a static binary, so a missing library means a rebuild, not an install.

Whether the archived Python course is still worth reading

Both are open source and need no account. Each teaches the same lifecycle over the same incident seed data, with the same ADK, agentgateway, kagent, and local Qwen3. Only one of them is maintained.

The Python course is archived, not gone: v0.7.0 is complete on the python branch, and you can read or clone it there. Read it when the inner loop is your work — exploring a domain, iterating on prompts and tools, living in the ecosystem your data tooling already speaks. It is not maintained, so treat its pinned versions as a snapshot of August 2026.

Run this one when the outer loop is the problem: the agent has to survive being deployed, restarted, throttled, audited, and paged on. That is where the static binary, the typed configuration, the parse-at-the-boundary domain types, and the evaluation boundary enforced by mise run eval:validate start paying for the ceremony they cost.

Reading both is not redundant: the concepts transfer almost one to one, so the second pass is mostly recognition. If you only run one, run this one — it is the version that gets fixed.

What you can do now

  • You can name the Go package that owns each LangGraph concept you use, and open it instead of reading the course in order.
  • You know the three Python habits that do not carry over: the notebook loop, runtime patching, and runtime dependency installation.
  • You can say which of the two courses fits the loop you are fixing, and why taking the other afterwards is mostly recognition.

You arrived knowing how to build an agent; only the addresses changed.

Continue to 8.7. Capstone if you have finished Chapter 7, or start at 0.0. Course if you have not.