LinkedIn Builds AI Agent Context System for Code Workflows

Context Engineering at LinkedIn: How We Built an Organizational Context Layer for AI Agents with MCP — a presentation by LinkedIn software engineer Ajay Prakash detailed how his team developed a system called Contextual Agent Playbooks and Tools. This framework provides AI coding agents with the internal knowledge required to operate effectively across LinkedIn’s extensive codebase.
Shifting from Autocomplete to Agent-Assisted Workflows
Early AI coding assistants, such as GitHub Copilot, functioned primarily as autocomplete tools, helping developers complete lines or blocks of code. The introduction of agent mode expanded capabilities by granting these tools access to file editing and terminal commands. By early 2025, industry observers like Andrej Karpathy began referring to this approach as “vibe coding,” where agents executed changes without close oversight. At LinkedIn, engineers initially adopted this method, but it proved ineffective. The company’s complex infrastructure, comprising thousands of microservices and custom frameworks, left agents without the necessary context to deliver reliable outcomes.
Creating a Knowledge Integration System
The turning point arrived when Anthropic introduced the Model Context Protocol (MCP), an open standard for connecting tools to AI agents. LinkedIn recognized its potential and began integrating existing tools, such as code search, documentation readers, and feature flag managers, into the MCP framework. This gave agents direct access to LinkedIn’s internal systems, with code search proving particularly valuable. It allowed agents to scan thousands of repositories for relevant code snippets and file contents.
However, tool integration alone did not resolve all challenges. Engineers discovered that even with access to documentation and code, agents struggled with complex workflows. Three key issues persisted: fragmented knowledge spread across Slack discussions and wikis, overwhelming context from excessive tool outputs, and the absence of long-term memory. Agents repeatedly relearned processes, consuming both computational resources and time.
Incident Response and Workflow Automation
When an issue arises, the coding agent fetches debugging instructions for the affected service, then retrieves logs, metrics, and recent deployments. It identifies whether the problem stems from a downstream service generating errors and follows similar debugging steps for that service.
Read Also: Facial verification systems require robust architecture
The agent traces the root cause to a recent buggy code change that was deployed, and compiles a detailed summary outlining the issue, its source, and mitigation steps. After user confirmation, it automatically executes the fix within minutes.
Developing Playbooks for Task Automation
Currently, over 600 playbooks automate workflows across LinkedIn, covering tasks from debugging to code generation. The system supports 8,000 daily users, including engineers, product managers, designers, and technical program managers. Plans are underway to automate playbook creation and updates using background agents, further accelerating adoption. The team now faces the challenge of ensuring playbooks remain accurate as workflows evolve.
Expanding the System’s Reach
Early implementation revealed a critical bottleneck: managing thousands of tools and playbooks within a single MCP server. Each tool consumes context space, and performance declined noticeably once the system exceeded roughly 30 tools. To mitigate this, LinkedIn shifted from direct tool exposure to a search-based approach. Agents now query a dedicated search tool using keywords or tags, retrieve relevant matches, and select the appropriate tool based on its description.
Ensuring Reliability and Broadening Use
Usage data informs deprecation decisions, with inactive playbooks flagged for removal. AI-powered code reviews during pull requests help eliminate redundancies, preventing unnecessary duplication. Over time, the system has delivered measurable improvements: productivity rose by approximately 20% while maintaining stable code quality and system reliability.
