---
title: "Using Docker AI Tools for Devs to Provide Context for Better Code Fixes"
description: "LLMs fix lint violations far better when given the surrounding code, so Docker Labs built a prompt-driven pipeline where each step runs in a container: Pylint produces a violation report, violations are loaded into SQLite, and Tree-sitter parses the project into an AST whose top-level statement ranges are indexed alongside the source."
url: "https://swe.quest/articles/using-docker-ai-tools-for-devs-to-provide-context-for-better-code-fixes-c0163de9f3027f93"
canonical: "https://www.docker.com/blog/using-docker-ai-tools-for-devs-to-provide-context-for-better-code-fixes/"
source: "Docker"
published: "2024-10-21"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["ai-coding","ai-agents","static-analysis","containers","python"]
---

# Using Docker AI Tools for Devs to Provide Context for Better Code Fixes

A post on [Docker](https://swe.quest/sources/docker.md), published 2024-10-21, 8 min read, How-to. Original: [https://www.docker.com/blog/using-docker-ai-tools-for-devs-to-provide-context-for-better-code-fixes/](https://www.docker.com/blog/using-docker-ai-tools-for-devs-to-provide-context-for-better-code-fixes/)

## Summary

LLMs fix lint violations far better when given the surrounding code, so Docker Labs built a prompt-driven pipeline where each step runs in a container: Pylint produces a violation report, violations are loaded into SQLite, and Tree-sitter parses the project into an AST whose top-level statement ranges are indexed alongside the source. The LLM then queries this database (writing its own SQL from the schema) to retrieve the enclosing function for a violation before proposing a fix. This sidesteps context-window limits of reading whole files, and the same pattern generalizes to any tool that maps code locations to issues.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Static analysis](https://swe.quest/tags/static-analysis.md) (Engineering practices)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- LLM tool calling basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- Docker containers ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- Python linting ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

Docker AI Tools for Devs, Pylint, Tree-sitter, SQLite, Docker Labs

## Related posts

- [Getting Started with the Labs AI Tools for Devs Docker Desktop Extension](https://swe.quest/articles/getting-started-with-the-labs-ai-tools-for-devs-docker-desktop-extension-82e61806b7468ca8.md): Docker · 2024-09-09 · Medium · 4 min read · AI agents, LLMs, Containers, Developer tools
  The Labs AI Tools for Devs Docker Desktop extension runs LLM prompts against local projects.
- [Using an AI Assistant to Script Tools](https://swe.quest/articles/using-an-ai-assistant-to-script-tools-714a1e238504d1ea.md): Docker · 2024-10-07 · Medium · 5 min read · AI agents, Sandboxing & isolation, Containers, LLMs
  Instead of feeding large datasets like Pylint violation JSON through an LLM to transform them into SQL INSERT statements, the assistant can be prompted to write a JavaScript program that performs the transformation, then run it through a tool call.
- [How to Fix ESLint Violations with AI Assistance](https://swe.quest/articles/how-to-fix-eslint-violations-with-ai-assistance-74d040edadf71958.md): Docker · 2024-08-26 · Medium · 8 min read · AI for coding, AI agents, Static analysis, TypeScript, LLMs
  An LLM can produce correct fixes for ESLint violations once it has tools that supply minimal, precise context.
- [Adding the ESLint Tool to an AI Assistant: Improving Recommendations for JS/TS Projects](https://swe.quest/articles/adding-the-eslint-tool-to-an-ai-assistant-improving-recommendations-for-js-ts-d83ca2ba37ac984c.md): Docker · 2024-08-12 · Medium · 7 min read · AI for coding, Static analysis, JavaScript, TypeScript, Containers
  An AI assistant gets better at linting JavaScript and TypeScript projects when it is given ESLint tooling instead of relying on the LLM's built-in knowledge.
- [Build Your Own AI-Driven Code Analysis Chatbot for Developers with the GenAI Stack](https://swe.quest/articles/build-your-own-ai-driven-code-analysis-chatbot-for-developers-with-the-genai-062f35bb279ec41b.md): Docker · 2024-06-06 · Medium · 10 min read · RAG & retrieval, LLMs, AI for coding, Containers, Python
  Code Explorer, a winning Docker AI/ML Hackathon project, is a RAG chatbot that answers questions about a local codebase by parsing source files, chunking them with LangChain's RecursiveCharacterTextSplitter (5000 characters with 500 overlap), and storing embeddings in a Neo4j vector store.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
