Module 10 Lesson 5: Enterprise Integration
Connecting to the real world. Integrating agents with SQL, ERP systems, and internal authentication.
Enterprise Integration: Agents in the Workplace
Building an agent that searches the web is easy. Building an agent that can safely access your company's SQL database, Slack channel, or SAP system is the real challenge. Enterprise integration requires Permissions, Security, and High Reliability.
1. The "Auth" Problem
When an agent calls a tool (e.g., get_user_revenue), it shouldn't have one big "Admin" key. It should use the User's Identity.
- The Wrong Way: The agent has a server-side secret key that can access all data.
- The Right Way: The agent receives a temporary OAuth token representing the user who is currently chatting.
This ensures that the agent can only see information that the human user is allowed to see.
2. Structured Data Connectors
ADK provides standardized connectors for common enterprise tools.
| System | Tool Type | Typical Action |
|---|---|---|
| PostgreSQL | Read/Only SQL | "Find all users from California." |
| Salesforce | CRM Connector | "Update the status of Lead 123." |
| Slack | Messaging API | "Notify the dev team about the bug." |
| Box/Google Drive | Document Search | "Summarize the latest project plan." |
3. The "Semantic Layer"
Don't just give an agent raw access to a database with 500 tables. It will get lost. Create a Semantic Layer (Views or a specific API) that summarizes the data structure.
- Raw SQL:
SELECT * FROM users_v2_internal_meta...(Confusing). - Semantic Tool:
get_user_summary(email)(Clear).
4. Visualizing the Enterprise Flow
graph LR
User[Human] -->|Session Token| Agent[ADK Agent]
Agent -->|Token Passed| Tool[Tool: Salesforce]
Agent -->|Token Passed| DB[Tool: SQL Reader]
Tool -->|Result| Agent
DB -->|Result| Agent
Agent --> Response[Verified Answer]
5. Engineering Tip: Read-Only by Default
When integrating an agent with your enterprise for the first time, never give it "Write" access.
- Start with Read-Only tools.
- Monitor how the agent uses them.
- Only add "Write" tools (like
delete_roworupdate_user) once you have a Human-in-the-Loop checkpoint (Module 7).
Key Takeaways
- Identity Propagation (using user tokens) is mandatory for enterprise security.
- Semantic Layers make it easier for agents to understand complex data structures.
- Standardized Connectors (ADK library) reduce development time and errors.
- Read-only starters prevent accidental data destruction during the agent's learning phase.