The Gateway is the brain that sits between your IDE and the AI provider. It is a self-hosted FastAPI service wrapping a LangGraph deep agent. The PyCharm plugin never talks to an LLM directly — it talks to the Gateway, which runs the agent turn, uses MCP tools, calls the model provider you configured, and streams every step back to the IDE in real time.
Each message from the IDE becomes one turn on the graph. The gateway drains the LangGraph event stream and forwards frames to the plugin as they happen, so you watch the agent think, call tools and write code live:
user_message frame arrives on the thread's WebSocket.resume; otherwise it sends the final frame.
HITL is implemented as a real LangGraph interrupt. When the agent is about to
take an action that needs approval, the gateway pauses the graph, sends an
interrupt frame (with a preview of what it wants to do) and holds the turn. The
plugin shows the prompt; your decision returns as a resume frame carrying a
Command(resume=…), which continues the same turn from exactly where it
paused — no replay, no lost context.
Whether HITL is active is decided per thread by the Auto toggle the plugin sends: Auto off enables HITL (the gateway interrupts for approval), Auto on disables it (the graph runs without pausing). The gateway stores that (and the redaction preference) on the thread's record, applied on every frame.
One exception overrides the Auto setting: a fixed set of high-risk shell commands —
git, sudo and docker — always triggers
an approval interrupt, even when Auto is on. The gateway detects these commands before running
them and pauses the turn regardless of the thread's HITL preference, so destructive or
system-level actions can never run unattended.
The gateway keeps an in-memory ThreadRegistry: one record per conversation
holding its message history, HITL/redaction settings and the machine identity
(machine_id, OS, arch, hostname) the plugin sent in its hello frame.
Because state lives on the record and not in a request-scoped variable, threads survive across
turns and can be rehydrated after a reconnect.
Routing is purely by thread_id against a single gateway hub, which is what makes
multi-user and multi-machine setups work: two agents on different machines are just two
threads on the same hub. Serving several projects in parallel from separate workstations is
already tested; the first release rolls out to a limited number of users while our
infrastructure scales to a full multi-user deployment.
<<REDACTED_*>> tokens (for example
<<REDACTED_IP_ADDRESS>>). Redaction is a per-thread setting driven by
the same hello-frame mechanism as HITL, so you turn it on or off from the plugin.
Real work often spans several projects — a backend and the library it consumes, for instance. The Gateway includes an Agent Coordination Protocol (ACP) so one agent can ask the agent working on another project to make a change, then continue once it reports back.
acp_request delivers a masked request that starts a fresh, independent turn on the peer agent; the requesting agent's turn simply ends.acp_report is delivered as a new turn on the original agent, which then resumes and finishes the task.This design deliberately avoids graph-level suspension, so no node is ever replayed and each side runs one clean turn.
The gateway builds its LLM through a single multi-provider factory, so the very same agent can run on OpenAI, Anthropic, Google or a fully local Ollama server just by changing configuration. With Ollama the whole stack is offline.
Your provider API keys are never baked into the plugin jar or persisted on the gateway. The
PyCharm plugin stores each key (Anthropic · OpenAI · Google) in the
operating system's keystore via IntelliJ's PasswordSafe — that
means the native credential store on your own machine (macOS Keychain, Windows Credential
Manager, or the Linux Secret Service / KeePass fallback).
Running fully offline with Ollama means the model itself runs on your host, and that is GPU work. Like the RAG's embedding phase, Ollama is far more capable with a GPU behind it — NVIDIA hardware is the recommended and tested path.