whatisgithub

What is knabit-coding-agent?

prateek1217/knabit-coding-agent — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A local AI coding assistant that summarizes old conversation turns to keep long coding sessions with Gemini affordable.

Mindmap

mindmap
  root((repo))
    What it does
      Local coding assistant
      Smart context compression
      File and git operations
    Tech stack
      Python
      LangGraph
      LangChain
      Gemini
      FastMCP
    Use cases
      Long running coding sessions
      Refactor and debug code locally
      Control cost of AI context
    Audience
      Developers
      Vibe coders
      AI tinkerers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run a local coding assistant that reads, writes, and refactors code in your project

USE CASE 2

Keep long AI coding sessions affordable by automatically summarizing older conversation turns

USE CASE 3

Let an agent run shell commands, search code, and perform git operations through an MCP server

What is it built with?

PythonLangGraphLangChainGeminiFastMCPuv

How does it compare?

prateek1217/knabit-coding-agenta-bissell/unleash-liteabhiinnovates/whatsapp-hr-assistant
Stars111
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/54/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a Google API key for Gemini and the uv Python package manager.

So what is it?

Knabit Coding Agent is an AI powered coding assistant that runs locally on your machine and helps you read, write, refactor, debug, and execute code within your project. Its standout feature is a smart context management system designed to keep long conversations affordable. The problem it addresses is that AI language models have a fixed context window, a limit on how much text they can process at once. If a coding assistant naively sends the entire conversation history on every query, token usage and cost grow with every exchange until the limit is hit and the agent breaks. Knabit solves this by keeping only a configurable number of recent conversation turns in full detail, controlled by a WINDOW_SIZE setting, and using the language model itself to summarize all older turns into a compact block. Because important decisions, file names, and code changes are compressed rather than discarded, the agent retains meaningful history without escalating cost. No external memory system such as a vector database is required. The architecture has two parts: agent.py acts as the brain, managing conversation history and routing messages through a LangGraph state machine with tools attached, server.py acts as the hands, running as a FastMCP server that exposes tools for reading and writing files, running shell commands, searching code, and performing git operations. When you type a query, the agent forwards it to the Gemini model, which can then call the MCP server to take real actions on your filesystem. It is built with LangGraph and LangChain and requires a Google API key for Gemini along with the uv Python package manager to install dependencies.

Copy-paste prompts

Prompt 1
Explain how the WINDOW_SIZE setting controls context summarization in this coding agent
Prompt 2
Walk me through setting up a Google API key and installing dependencies with uv for this project
Prompt 3
Show me how agent.py and server.py work together to let the agent take actions on my filesystem

Frequently asked questions

What is knabit-coding-agent?

A local AI coding assistant that summarizes old conversation turns to keep long coding sessions with Gemini affordable.

What language is knabit-coding-agent written in?

Mainly Python. The stack also includes Python, LangGraph, LangChain.

How hard is knabit-coding-agent to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is knabit-coding-agent for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.