Hi, I am a junior AI service engineer in Korea. This is my first post.
So, I’d never written Go before few days ago. I had FastAPI talking to OpenAI, a Go service persisting pod counts to PostgreSQL. Here’s the architecture and what actually worked.
AI gateway : Python + FastAPI
Engine : Go + Gin
State : PostgreSQL
Referencing OpenClaw, the user issues a command in natural language, such as “Increase the number of servers to 3.” Python (FastAPI) analyzes the intent using OpenAI. The final number of servers can be changed using the natural language input by the user.
Python
if ai_result.startswith("SCALE:"):
target_pods = int(ai_result.split(":")[1])
go_response = await http_client.post(
GO_ENGINE_SCALE_URL,
json={"target_pods": target_pods},
)
Go
_, err := db.Exec(
"INSERT INTO infra_status (active_pods, status, cpu_usage) VALUES ($1, $2, $3)",
req.TargetPods, status, cpuUsage,
)
Technical Challenges & Lessons
- I have learned the technology for integrating complex pipelines where two servers coexist in independent ports and exchange data in real-time without errors via standard RESTful API communication (HTTP).
- Open-Source Adaptability: Learned how to analyze open-source architecture (OpenClaw) and redesign it to meet specific business requirements (Orchestration).
Next, I would like to add a feature that appropriately distributes users when the number of servers increases, and ensures that users who are already connected remain connected to the same server.
THX

Top comments (0)