Dependency injection keeps core logic focused by giving an object the components it needs instead of making those components internally. section 10.5.2
Passing services into an agent graph
Create the language model and vector store in Bot, then pass them into SupportAgentGraph. The graph stores them as self.llm and self.vector_store, leaving setup outside the graph’s core logic and making automated testing easier. section 10.5.2
A practical dependency-injection arrangement separates responsibilities:
- Bot creates configuration-dependent services such as VectorStore. section 10.5.2
- SupportAgentGraph receives those services through its constructor. section 10.5.2
- Graph nodes use the injected vector store for retrieval without constructing it themselves. section 10.5.2




















