agentchanti 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. agentchanti-0.1.0/LICENSE +21 -0
  2. agentchanti-0.1.0/PKG-INFO +361 -0
  3. agentchanti-0.1.0/README.md +290 -0
  4. agentchanti-0.1.0/agentchanti/__init__.py +13 -0
  5. agentchanti-0.1.0/agentchanti/agents/__init__.py +0 -0
  6. agentchanti-0.1.0/agentchanti/agents/analyser.py +1020 -0
  7. agentchanti-0.1.0/agentchanti/agents/base.py +101 -0
  8. agentchanti-0.1.0/agentchanti/agents/coder.py +150 -0
  9. agentchanti-0.1.0/agentchanti/agents/intent.py +2310 -0
  10. agentchanti-0.1.0/agentchanti/agents/planner.py +1442 -0
  11. agentchanti-0.1.0/agentchanti/agents/reviewer.py +159 -0
  12. agentchanti-0.1.0/agentchanti/agents/search.py +628 -0
  13. agentchanti-0.1.0/agentchanti/agents/tester.py +326 -0
  14. agentchanti-0.1.0/agentchanti/api.py +701 -0
  15. agentchanti-0.1.0/agentchanti/checkpoint.py +87 -0
  16. agentchanti-0.1.0/agentchanti/cli_display.py +1150 -0
  17. agentchanti-0.1.0/agentchanti/config.py +527 -0
  18. agentchanti-0.1.0/agentchanti/diff_display.py +661 -0
  19. agentchanti-0.1.0/agentchanti/editing/__init__.py +17 -0
  20. agentchanti-0.1.0/agentchanti/editing/chunk_editor.py +1138 -0
  21. agentchanti-0.1.0/agentchanti/editing/context_slicer.py +377 -0
  22. agentchanti-0.1.0/agentchanti/editing/diff_parser.py +373 -0
  23. agentchanti-0.1.0/agentchanti/editing/metrics.py +129 -0
  24. agentchanti-0.1.0/agentchanti/editing/patch_applier.py +310 -0
  25. agentchanti-0.1.0/agentchanti/editing/scope_resolver.py +388 -0
  26. agentchanti-0.1.0/agentchanti/embedding_store.py +121 -0
  27. agentchanti-0.1.0/agentchanti/embedding_store_sqlite.py +116 -0
  28. agentchanti-0.1.0/agentchanti/executor.py +1303 -0
  29. agentchanti-0.1.0/agentchanti/git_utils.py +80 -0
  30. agentchanti-0.1.0/agentchanti/kb/__init__.py +9 -0
  31. agentchanti-0.1.0/agentchanti/kb/cli.py +962 -0
  32. agentchanti-0.1.0/agentchanti/kb/context_builder.py +752 -0
  33. agentchanti-0.1.0/agentchanti/kb/global_kb/__init__.py +9 -0
  34. agentchanti-0.1.0/agentchanti/kb/global_kb/error_dict.py +436 -0
  35. agentchanti-0.1.0/agentchanti/kb/global_kb/seeder.py +3874 -0
  36. agentchanti-0.1.0/agentchanti/kb/global_kb/store.py +834 -0
  37. agentchanti-0.1.0/agentchanti/kb/global_kb/updater.py +497 -0
  38. agentchanti-0.1.0/agentchanti/kb/health.py +162 -0
  39. agentchanti-0.1.0/agentchanti/kb/local/__init__.py +6 -0
  40. agentchanti-0.1.0/agentchanti/kb/local/embedder.py +586 -0
  41. agentchanti-0.1.0/agentchanti/kb/local/graph.py +702 -0
  42. agentchanti-0.1.0/agentchanti/kb/local/indexer.py +457 -0
  43. agentchanti-0.1.0/agentchanti/kb/local/manifest.py +404 -0
  44. agentchanti-0.1.0/agentchanti/kb/local/parser.py +893 -0
  45. agentchanti-0.1.0/agentchanti/kb/local/searcher.py +467 -0
  46. agentchanti-0.1.0/agentchanti/kb/local/sqlite_vector_store.py +427 -0
  47. agentchanti-0.1.0/agentchanti/kb/local/watcher.py +304 -0
  48. agentchanti-0.1.0/agentchanti/kb/project_orientation.py +485 -0
  49. agentchanti-0.1.0/agentchanti/kb/runtime_watcher.py +344 -0
  50. agentchanti-0.1.0/agentchanti/kb/startup.py +400 -0
  51. agentchanti-0.1.0/agentchanti/knowledge.py +757 -0
  52. agentchanti-0.1.0/agentchanti/language.py +447 -0
  53. agentchanti-0.1.0/agentchanti/language_backend.py +718 -0
  54. agentchanti-0.1.0/agentchanti/llm/__init__.py +39 -0
  55. agentchanti-0.1.0/agentchanti/llm/anthropic_client.py +157 -0
  56. agentchanti-0.1.0/agentchanti/llm/base.py +173 -0
  57. agentchanti-0.1.0/agentchanti/llm/cancellation.py +73 -0
  58. agentchanti-0.1.0/agentchanti/llm/gemini_client.py +184 -0
  59. agentchanti-0.1.0/agentchanti/llm/lm_studio.py +191 -0
  60. agentchanti-0.1.0/agentchanti/llm/ollama.py +152 -0
  61. agentchanti-0.1.0/agentchanti/llm/openai_client.py +204 -0
  62. agentchanti-0.1.0/agentchanti/orchestrator/__init__.py +27 -0
  63. agentchanti-0.1.0/agentchanti/orchestrator/classification.py +349 -0
  64. agentchanti-0.1.0/agentchanti/orchestrator/cli.py +1448 -0
  65. agentchanti-0.1.0/agentchanti/orchestrator/dependency_check.py +1627 -0
  66. agentchanti-0.1.0/agentchanti/orchestrator/diagnosis.py +1218 -0
  67. agentchanti-0.1.0/agentchanti/orchestrator/error_router.py +380 -0
  68. agentchanti-0.1.0/agentchanti/orchestrator/memory.py +469 -0
  69. agentchanti-0.1.0/agentchanti/orchestrator/pipeline.py +5207 -0
  70. agentchanti-0.1.0/agentchanti/orchestrator/plan_optimizer.py +1000 -0
  71. agentchanti-0.1.0/agentchanti/orchestrator/plan_step.py +2110 -0
  72. agentchanti-0.1.0/agentchanti/orchestrator/step_handlers.py +6715 -0
  73. agentchanti-0.1.0/agentchanti/orchestrator/test_analyzer.py +630 -0
  74. agentchanti-0.1.0/agentchanti/plugins/__init__.py +58 -0
  75. agentchanti-0.1.0/agentchanti/plugins/registry.py +97 -0
  76. agentchanti-0.1.0/agentchanti/project_scanner.py +294 -0
  77. agentchanti-0.1.0/agentchanti/report.py +235 -0
  78. agentchanti-0.1.0/agentchanti/search_provider.py +317 -0
  79. agentchanti-0.1.0/agentchanti/step_cache.py +99 -0
  80. agentchanti-0.1.0/agentchanti/test_syntax.py +12 -0
  81. agentchanti-0.1.0/agentchanti/tui_editor.py +451 -0
  82. agentchanti-0.1.0/agentchanti.egg-info/PKG-INFO +361 -0
  83. agentchanti-0.1.0/agentchanti.egg-info/SOURCES.txt +105 -0
  84. agentchanti-0.1.0/agentchanti.egg-info/dependency_links.txt +1 -0
  85. agentchanti-0.1.0/agentchanti.egg-info/entry_points.txt +2 -0
  86. agentchanti-0.1.0/agentchanti.egg-info/requires.txt +25 -0
  87. agentchanti-0.1.0/agentchanti.egg-info/top_level.txt +1 -0
  88. agentchanti-0.1.0/pyproject.toml +87 -0
  89. agentchanti-0.1.0/setup.cfg +4 -0
  90. agentchanti-0.1.0/tests/test_checkpoint.py +166 -0
  91. agentchanti-0.1.0/tests/test_classification.py +168 -0
  92. agentchanti-0.1.0/tests/test_cli_display_status.py +146 -0
  93. agentchanti-0.1.0/tests/test_content_fix.py +127 -0
  94. agentchanti-0.1.0/tests/test_dependency_check.py +949 -0
  95. agentchanti-0.1.0/tests/test_embeddings.py +181 -0
  96. agentchanti-0.1.0/tests/test_flow.py +32 -0
  97. agentchanti-0.1.0/tests/test_import_validation.py +254 -0
  98. agentchanti-0.1.0/tests/test_intent_sanitize.py +136 -0
  99. agentchanti-0.1.0/tests/test_path_resolution.py +280 -0
  100. agentchanti-0.1.0/tests/test_review_context.py +98 -0
  101. agentchanti-0.1.0/tests/test_safety.py +57 -0
  102. agentchanti-0.1.0/tests/test_search_agent.py +624 -0
  103. agentchanti-0.1.0/tests/test_search_step.py +145 -0
  104. agentchanti-0.1.0/tests/test_slim_context.py +148 -0
  105. agentchanti-0.1.0/tests/test_subproject_fixes.py +443 -0
  106. agentchanti-0.1.0/tests/test_test_pipeline.py +691 -0
  107. agentchanti-0.1.0/tests/test_uniquify.py +100 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Uday Kanth
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,361 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentchanti
3
+ Version: 0.1.0
4
+ Summary: A multi-agent AI coding system with built-in RAG — local or cloud, CLI or API.
5
+ Author: Uday Kanth
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Uday Kanth
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/udaykanth/agentchanti
29
+ Project-URL: Repository, https://github.com/udaykanth/agentchanti
30
+ Project-URL: Issues, https://github.com/udaykanth/agentchanti/issues
31
+ Keywords: ai,agent,llm,coding-assistant,ollama,lm-studio,openai,anthropic,gemini,rag,code-generation
32
+ Classifier: Development Status :: 3 - Alpha
33
+ Classifier: Environment :: Console
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Topic :: Software Development :: Code Generators
42
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
43
+ Requires-Python: >=3.10
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: requests
47
+ Requires-Dist: pyyaml
48
+ Requires-Dist: rich>=13.0
49
+ Requires-Dist: textual
50
+ Requires-Dist: networkx>=3.0
51
+ Requires-Dist: syntax_checker
52
+ Requires-Dist: tree-sitter>=0.22
53
+ Requires-Dist: tree-sitter-python
54
+ Requires-Dist: tree-sitter-javascript
55
+ Requires-Dist: tree-sitter-typescript
56
+ Requires-Dist: tree-sitter-java
57
+ Requires-Dist: tree-sitter-c
58
+ Requires-Dist: tree-sitter-cpp
59
+ Requires-Dist: tree-sitter-go
60
+ Requires-Dist: tree-sitter-rust
61
+ Requires-Dist: tree-sitter-ruby
62
+ Requires-Dist: tree-sitter-php
63
+ Requires-Dist: tree-sitter-c-sharp
64
+ Requires-Dist: watchdog>=3.0
65
+ Requires-Dist: tqdm>=4.60
66
+ Provides-Extra: dev
67
+ Requires-Dist: pytest>=7; extra == "dev"
68
+ Requires-Dist: ruff>=0.5; extra == "dev"
69
+ Requires-Dist: build>=1.0; extra == "dev"
70
+ Dynamic: license-file
71
+
72
+ <p align="center">
73
+ <pre>
74
+ _ _ ____ _ _ _
75
+ / \ __ _ ___ _ __ | |_ / ___| |__ __ _ _ __ | |_(_)
76
+ / _ \ / _` |/ _ \ '_ \| __| | | | '_ \ / _` | '_ \| __| |
77
+ / ___ \ (_| | __/ | | | |_ | |___| | | | (_| | | | | |_| |
78
+ /_/ \_\__, |\___|_| |_|\__| \____|_| |_|\__,_|_| |_|\__|_|
79
+ |___/
80
+ ━━ A u t o n o m o u s C o d e r ━━
81
+ </pre>
82
+ </p>
83
+
84
+ <p align="center">
85
+ <b>A multi-agent AI coding system with built-in RAG — local or cloud, CLI or API.</b><br>
86
+ Plans. Codes. Reviews. Tests. Understands your codebase.
87
+ </p>
88
+
89
+ <p align="center">
90
+ <img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python 3.10+">
91
+ <img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License">
92
+ <img src="https://img.shields.io/badge/LLM-Local%20%2B%20Cloud-orange" alt="Local + Cloud">
93
+ <img src="https://img.shields.io/badge/providers-Ollama%20%7C%20LM%20Studio%20%7C%20OpenAI%20%7C%20Gemini%20%7C%20Claude-blueviolet" alt="Multiple Providers">
94
+ </p>
95
+
96
+ ## What is AgentChanti?
97
+
98
+ AgentChanti ships with a built-in RAG system. Before any agent writes code, it automatically retrieves the most relevant functions, classes, and docs from your codebase and injects them as context — so even a local 7B model running in Ollama understands your project structure and coding conventions. Teams can add internal docs, architecture decisions, and coding standards to the Global KB, and every agent on every run picks them up automatically.
99
+
100
+ AgentChanti is a **command-line tool and Python library** that takes a plain English description of a coding task and autonomously builds the software for you using a team of specialized AI agents:
101
+
102
+ | Agent | Role |
103
+ |-------|------|
104
+ | **Planner** | Breaks your task into numbered, actionable steps |
105
+ | **Coder** | Writes clean, idiomatic code for each step |
106
+ | **Reviewer** | Checks code for bugs, style issues, and correctness |
107
+ | **Tester** | Generates and runs unit tests to verify everything works |
108
+
109
+ Supports local LLMs ([Ollama](https://ollama.com), [LM Studio](https://lmstudio.ai)) and cloud providers (OpenAI, Google Gemini, Anthropic Claude).
110
+
111
+ ### Beyond the CLI — Use It as a Service
112
+
113
+ AgentChanti ships as both a CLI and a **Python library**, so it can be embedded directly into any service:
114
+
115
+ ```python
116
+ # Inside a Flask endpoint — trigger the full agent pipeline on a PR event
117
+ from agentchanti import run_task
118
+
119
+ @app.route("/pr-review", methods=["POST"])
120
+ def on_pull_request():
121
+ result = run_task(task="Generate unit tests for the changed files", auto=True)
122
+ return {"status": result.status, "files": result.files_written}
123
+ ```
124
+
125
+ The **plugin system** (`StepPlugin` base class) lets teams extend the pipeline with custom steps beyond code generation:
126
+
127
+ | Example Plugin | What It Does |
128
+ |----------------|--------------|
129
+ | PR test generator | Auto-generates tests when a PR is opened |
130
+ | Image validator | Validates assets against design specs using a vision model |
131
+ | Deployment gate | Runs lint, security scan, or compliance checks before deploy |
132
+ | Custom linter | Enforces team-specific coding standards as a pipeline step |
133
+
134
+ Plugins are discovered automatically from your config or via setuptools entry points — no changes to the core pipeline needed.
135
+
136
+ ### Built-in RAG — Any LLM Understands Your Codebase
137
+
138
+ AgentChanti includes a **4-phase RAG system** that automatically indexes your project and injects relevant context into every agent prompt — so even a small local model running offline has deep awareness of your internal code and docs:
139
+
140
+ - **Code graph** — tree-sitter parses your codebase into a symbol graph (functions, classes, imports, call edges) across 11 languages
141
+ - **Semantic search** — every function and class is embedded into a local SQLite vector store; agents retrieve the most relevant symbols before writing any code
142
+ - **Global KB** — add your internal docs, ADRs, and coding standards; every agent picks them up automatically
143
+ - **Error dictionary** — maps known error patterns to fixes so agents self-correct without extra LLM calls
144
+
145
+ All storage is local SQLite — no cloud vector database required. Works fully offline with local LLMs.
146
+
147
+ ---
148
+
149
+ ## RAG Architecture
150
+
151
+ AgentChanti uses a **4-phase Retrieval-Augmented Generation (RAG)** system to give every agent deep awareness of your codebase. Before any code is written, the system automatically indexes your project and injects the most relevant context into each LLM prompt.
152
+
153
+ ```
154
+ ┌──────────────────────────────────────────────────────────────┐
155
+ │ Your Coding Task │
156
+ └──────────────────┬───────────────────────────────────────────┘
157
+
158
+ ┌──────────────────────────────────────────────────────────────┐
159
+ │ Phase 1: Code Graph Tree-sitter AST parsing │
160
+ │ ─────────────────── Classes, functions, imports, │
161
+ │ call edges → NetworkX graph │
162
+ ├──────────────────────────────────────────────────────────────┤
163
+ │ Phase 2: Semantic KB Embed symbols → SQLite vectors │
164
+ │ ──────────────────── Cosine similarity search │
165
+ │ Graph-enriched results │
166
+ ├──────────────────────────────────────────────────────────────┤
167
+ │ Phase 3: Global KB Error-fix dictionary (regex) │
168
+ │ ────────────────── Coding patterns, ADRs │
169
+ │ Behavioral instructions │
170
+ ├──────────────────────────────────────────────────────────────┤
171
+ │ Phase 4: Context Builder Intent detection (error/review) │
172
+ │ ──────────────────────── Retrieve → rank → budget (4000t) │
173
+ │ Inject into agent prompt │
174
+ └──────────────────┬───────────────────────────────────────────┘
175
+
176
+ ┌──────────────────────────────────────────────────────────────┐
177
+ │ Planner / Coder / Reviewer / Tester │
178
+ └──────────────────────────────────────────────────────────────┘
179
+ ```
180
+
181
+ | Phase | What It Does | Storage |
182
+ |-------|-------------|---------|
183
+ | **Code Graph** | Parses AST with tree-sitter (11 languages), builds a directed graph of symbols and call edges | `graph.pkl` + `index.db` |
184
+ | **Semantic KB** | Embeds functions/classes into vectors, enables natural-language search over your code | `vectors.db` (SQLite) |
185
+ | **Global KB** | Maps error patterns to fixes, stores coding best practices and behavioral rules | `global_kb.db` (SQLite) |
186
+ | **Context Builder** | Assembles retrieved context per-step with token budgeting and priority ranking | In-memory |
187
+
188
+ Additional capabilities:
189
+ - **Project Orientation** -- auto-detects language, framework, test runner, and directory structure; injects as a grounding block in every prompt
190
+ - **Runtime Watcher** -- monitors file changes during execution and triggers incremental re-indexing in the background
191
+ - **Smart Startup** -- < 10ms for unchanged projects; incremental or full re-index only when needed
192
+
193
+ All storage is local SQLite -- no external vector database required. See [documentation.md](documentation.md#rag-architecture) for the full technical deep-dive.
194
+
195
+ ---
196
+
197
+ ## Getting Started
198
+
199
+ ### Prerequisites
200
+
201
+ - **Python 3.10+** ([python.org](https://www.python.org/downloads/))
202
+ - **Git** ([git-scm.com](https://git-scm.com/))
203
+
204
+ - A local LLM server **or** a cloud API key
205
+
206
+ ### Installation
207
+
208
+ **Option 1: pipx (recommended for end users)**
209
+
210
+ `pipx` installs CLI tools into isolated environments and puts them on
211
+ your `PATH` — no virtualenv to activate, no `pip install` polluting
212
+ your global site-packages.
213
+
214
+ ```bash
215
+ pipx install agentchanti
216
+ agentchanti --help
217
+ ```
218
+
219
+ To upgrade later: `pipx upgrade agentchanti`. To install pre-release
220
+ builds straight from `main`: `pipx install
221
+ git+https://github.com/udaykanth/agentchanti.git`.
222
+
223
+ > **Note:** The package will be on PyPI once the first tagged release
224
+ > is cut. Until then, use Option 2 or 3 below.
225
+
226
+ **Option 2: Clone and install (for contributors / latest code)**
227
+
228
+ ```bash
229
+ git clone https://github.com/udaykanth/agentchanti.git
230
+ cd agentchanti
231
+
232
+ python3 -m venv .venv
233
+ source .venv/bin/activate # Linux/macOS
234
+ .venv\Scripts\activate # Windows
235
+
236
+ python -m pip install -e ".[dev]" # includes pytest + ruff for tests
237
+ agentchanti --help
238
+ ```
239
+
240
+ **Option 3: Convenience scripts**
241
+
242
+ If you'd rather not type the venv steps yourself, the repo ships
243
+ helper scripts that do the same thing:
244
+
245
+ ```bash
246
+ git clone https://github.com/udaykanth/agentchanti.git
247
+ cd agentchanti
248
+
249
+ # Linux / macOS
250
+ chmod +x install.sh && ./install.sh
251
+
252
+ # Windows
253
+ ./install.bat
254
+
255
+ source .venv/bin/activate # Linux/macOS
256
+ .venv\Scripts\activate # Windows
257
+ ```
258
+
259
+ > **Why no `curl | bash` installer?** AgentChanti is a Python package,
260
+ > not a single static binary. The standard Python tooling (`pipx`,
261
+ > `pip`) already handles isolated installs, version pinning, and
262
+ > upgrades — wrapping that in a shell script downloaded over HTTPS
263
+ > would add an attack surface without adding any value.
264
+
265
+ ---
266
+
267
+ ## Usage
268
+
269
+ ```bash
270
+ agentchanti "<task description>" [options]
271
+ ```
272
+
273
+ ### Quick Examples
274
+
275
+ ```bash
276
+ # With Ollama
277
+ agentchanti "Create a Flask REST API with CRUD" --provider ollama --model deepseek-coder-v2:16b
278
+
279
+ # With OpenAI
280
+ OPENAI_API_KEY="sk-..." agentchanti "Build a CLI tool" --provider openai --model gpt-4o-mini
281
+
282
+ # With Gemini
283
+ GEMINI_API_KEY="..." agentchanti "Build a REST API" --provider gemini --model gemini-2.5-flash
284
+
285
+ # With Claude
286
+ ANTHROPIC_API_KEY="sk-ant-..." agentchanti "Build a CLI tool" --provider anthropic --model claude-sonnet-4
287
+
288
+ # Non-interactive (CI/scripts)
289
+ agentchanti "Generate unit tests" --auto --no-git --no-report
290
+ ```
291
+
292
+ ### All Options
293
+
294
+ | Flag | Description | Default |
295
+ |------|-------------|---------|
296
+ | `"task"` | The coding task to perform (required) | — |
297
+ | `--prompt-from-file` | Read task description from a file | — |
298
+ | `--provider` | `ollama`, `lm_studio`, `openai`, `gemini`, `anthropic` | `lm_studio` |
299
+ | `--model` | Model name | `deepseek-coder-v2-lite-instruct` |
300
+ | `--embed-model` | Embedding model name | `nomic-embed-text` |
301
+ | `--language` | Override auto-detected language | auto-detect |
302
+ | `--config` | Path to `.agentchanti.yaml` config file | auto-discover |
303
+ | `--auto` | Non-interactive mode (auto-approve plan) | off |
304
+ | `--no-embeddings` | Disable semantic embeddings | off |
305
+ | `--no-stream` | Disable streaming responses | off |
306
+ | `--no-git` | Disable git checkpoint/rollback | off |
307
+ | `--no-diff` | Disable diff preview before writing | off |
308
+ | `--no-cache` | Disable step-level caching | off |
309
+ | `--clear-cache` | Clear step cache before running | off |
310
+ | `--no-knowledge` | Disable project knowledge base | off |
311
+ | `--no-search` | Disable web search agent | off |
312
+ | `--no-kb` | Disable KB context injection | off |
313
+ | `--report` / `--no-report` | Enable/disable HTML report | on |
314
+ | `--resume` | Force resume from checkpoint | off |
315
+ | `--fresh` | Ignore checkpoint, start fresh | off |
316
+ | `--generate-yaml` | Generate `.agentchanti.yaml` and exit | off |
317
+
318
+ ### Knowledge Base Commands
319
+
320
+ Manage the project knowledge base via `agentchanti kb`:
321
+
322
+ ```bash
323
+ agentchanti kb embed # Embed symbols into the vector store
324
+ agentchanti kb search "query" # Semantic search over KB
325
+ agentchanti kb query find-callers X # Find all callers of a function
326
+ agentchanti kb error-lookup "msg" # Look up error fixes
327
+ agentchanti kb health # Show KB health report
328
+ agentchanti kb update # Pull global KB updates
329
+ ```
330
+
331
+ See [documentation.md](documentation.md) for the full list of KB commands.
332
+
333
+ ---
334
+
335
+ ## Documentation
336
+
337
+ For full documentation including architecture details, configuration reference, library API, plugin system, and troubleshooting, see **[documentation.md](documentation.md)**.
338
+
339
+ ---
340
+
341
+ ## Contributing
342
+
343
+ Contributions are welcome! Feel free to open issues or submit pull requests.
344
+
345
+ 1. Fork the repository
346
+ 2. Create a feature branch (`git checkout -b feature/my-feature`)
347
+ 3. Run the tests: `python -m pytest tests/ -v`
348
+ 4. Commit and push
349
+ 5. Open a pull request
350
+
351
+ ---
352
+
353
+ ## License
354
+
355
+ MIT License. See [LICENSE](LICENSE) for details.
356
+
357
+ ---
358
+
359
+ ## Disclaimer
360
+
361
+ > **This is a personal project by [Uday Kanth](https://github.com/udaykanthr).** It is not affiliated with, endorsed by, sponsored by, or in any way officially connected with my current or past employer(s), or any of their subsidiaries, clients, or affiliates. All opinions, code, and design decisions in this project are my own and do not represent the views or intellectual property of any organization I am or have been associated with. This project was built entirely on my own time using my own resources.
@@ -0,0 +1,290 @@
1
+ <p align="center">
2
+ <pre>
3
+ _ _ ____ _ _ _
4
+ / \ __ _ ___ _ __ | |_ / ___| |__ __ _ _ __ | |_(_)
5
+ / _ \ / _` |/ _ \ '_ \| __| | | | '_ \ / _` | '_ \| __| |
6
+ / ___ \ (_| | __/ | | | |_ | |___| | | | (_| | | | | |_| |
7
+ /_/ \_\__, |\___|_| |_|\__| \____|_| |_|\__,_|_| |_|\__|_|
8
+ |___/
9
+ ━━ A u t o n o m o u s C o d e r ━━
10
+ </pre>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <b>A multi-agent AI coding system with built-in RAG — local or cloud, CLI or API.</b><br>
15
+ Plans. Codes. Reviews. Tests. Understands your codebase.
16
+ </p>
17
+
18
+ <p align="center">
19
+ <img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python 3.10+">
20
+ <img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License">
21
+ <img src="https://img.shields.io/badge/LLM-Local%20%2B%20Cloud-orange" alt="Local + Cloud">
22
+ <img src="https://img.shields.io/badge/providers-Ollama%20%7C%20LM%20Studio%20%7C%20OpenAI%20%7C%20Gemini%20%7C%20Claude-blueviolet" alt="Multiple Providers">
23
+ </p>
24
+
25
+ ## What is AgentChanti?
26
+
27
+ AgentChanti ships with a built-in RAG system. Before any agent writes code, it automatically retrieves the most relevant functions, classes, and docs from your codebase and injects them as context — so even a local 7B model running in Ollama understands your project structure and coding conventions. Teams can add internal docs, architecture decisions, and coding standards to the Global KB, and every agent on every run picks them up automatically.
28
+
29
+ AgentChanti is a **command-line tool and Python library** that takes a plain English description of a coding task and autonomously builds the software for you using a team of specialized AI agents:
30
+
31
+ | Agent | Role |
32
+ |-------|------|
33
+ | **Planner** | Breaks your task into numbered, actionable steps |
34
+ | **Coder** | Writes clean, idiomatic code for each step |
35
+ | **Reviewer** | Checks code for bugs, style issues, and correctness |
36
+ | **Tester** | Generates and runs unit tests to verify everything works |
37
+
38
+ Supports local LLMs ([Ollama](https://ollama.com), [LM Studio](https://lmstudio.ai)) and cloud providers (OpenAI, Google Gemini, Anthropic Claude).
39
+
40
+ ### Beyond the CLI — Use It as a Service
41
+
42
+ AgentChanti ships as both a CLI and a **Python library**, so it can be embedded directly into any service:
43
+
44
+ ```python
45
+ # Inside a Flask endpoint — trigger the full agent pipeline on a PR event
46
+ from agentchanti import run_task
47
+
48
+ @app.route("/pr-review", methods=["POST"])
49
+ def on_pull_request():
50
+ result = run_task(task="Generate unit tests for the changed files", auto=True)
51
+ return {"status": result.status, "files": result.files_written}
52
+ ```
53
+
54
+ The **plugin system** (`StepPlugin` base class) lets teams extend the pipeline with custom steps beyond code generation:
55
+
56
+ | Example Plugin | What It Does |
57
+ |----------------|--------------|
58
+ | PR test generator | Auto-generates tests when a PR is opened |
59
+ | Image validator | Validates assets against design specs using a vision model |
60
+ | Deployment gate | Runs lint, security scan, or compliance checks before deploy |
61
+ | Custom linter | Enforces team-specific coding standards as a pipeline step |
62
+
63
+ Plugins are discovered automatically from your config or via setuptools entry points — no changes to the core pipeline needed.
64
+
65
+ ### Built-in RAG — Any LLM Understands Your Codebase
66
+
67
+ AgentChanti includes a **4-phase RAG system** that automatically indexes your project and injects relevant context into every agent prompt — so even a small local model running offline has deep awareness of your internal code and docs:
68
+
69
+ - **Code graph** — tree-sitter parses your codebase into a symbol graph (functions, classes, imports, call edges) across 11 languages
70
+ - **Semantic search** — every function and class is embedded into a local SQLite vector store; agents retrieve the most relevant symbols before writing any code
71
+ - **Global KB** — add your internal docs, ADRs, and coding standards; every agent picks them up automatically
72
+ - **Error dictionary** — maps known error patterns to fixes so agents self-correct without extra LLM calls
73
+
74
+ All storage is local SQLite — no cloud vector database required. Works fully offline with local LLMs.
75
+
76
+ ---
77
+
78
+ ## RAG Architecture
79
+
80
+ AgentChanti uses a **4-phase Retrieval-Augmented Generation (RAG)** system to give every agent deep awareness of your codebase. Before any code is written, the system automatically indexes your project and injects the most relevant context into each LLM prompt.
81
+
82
+ ```
83
+ ┌──────────────────────────────────────────────────────────────┐
84
+ │ Your Coding Task │
85
+ └──────────────────┬───────────────────────────────────────────┘
86
+
87
+ ┌──────────────────────────────────────────────────────────────┐
88
+ │ Phase 1: Code Graph Tree-sitter AST parsing │
89
+ │ ─────────────────── Classes, functions, imports, │
90
+ │ call edges → NetworkX graph │
91
+ ├──────────────────────────────────────────────────────────────┤
92
+ │ Phase 2: Semantic KB Embed symbols → SQLite vectors │
93
+ │ ──────────────────── Cosine similarity search │
94
+ │ Graph-enriched results │
95
+ ├──────────────────────────────────────────────────────────────┤
96
+ │ Phase 3: Global KB Error-fix dictionary (regex) │
97
+ │ ────────────────── Coding patterns, ADRs │
98
+ │ Behavioral instructions │
99
+ ├──────────────────────────────────────────────────────────────┤
100
+ │ Phase 4: Context Builder Intent detection (error/review) │
101
+ │ ──────────────────────── Retrieve → rank → budget (4000t) │
102
+ │ Inject into agent prompt │
103
+ └──────────────────┬───────────────────────────────────────────┘
104
+
105
+ ┌──────────────────────────────────────────────────────────────┐
106
+ │ Planner / Coder / Reviewer / Tester │
107
+ └──────────────────────────────────────────────────────────────┘
108
+ ```
109
+
110
+ | Phase | What It Does | Storage |
111
+ |-------|-------------|---------|
112
+ | **Code Graph** | Parses AST with tree-sitter (11 languages), builds a directed graph of symbols and call edges | `graph.pkl` + `index.db` |
113
+ | **Semantic KB** | Embeds functions/classes into vectors, enables natural-language search over your code | `vectors.db` (SQLite) |
114
+ | **Global KB** | Maps error patterns to fixes, stores coding best practices and behavioral rules | `global_kb.db` (SQLite) |
115
+ | **Context Builder** | Assembles retrieved context per-step with token budgeting and priority ranking | In-memory |
116
+
117
+ Additional capabilities:
118
+ - **Project Orientation** -- auto-detects language, framework, test runner, and directory structure; injects as a grounding block in every prompt
119
+ - **Runtime Watcher** -- monitors file changes during execution and triggers incremental re-indexing in the background
120
+ - **Smart Startup** -- < 10ms for unchanged projects; incremental or full re-index only when needed
121
+
122
+ All storage is local SQLite -- no external vector database required. See [documentation.md](documentation.md#rag-architecture) for the full technical deep-dive.
123
+
124
+ ---
125
+
126
+ ## Getting Started
127
+
128
+ ### Prerequisites
129
+
130
+ - **Python 3.10+** ([python.org](https://www.python.org/downloads/))
131
+ - **Git** ([git-scm.com](https://git-scm.com/))
132
+
133
+ - A local LLM server **or** a cloud API key
134
+
135
+ ### Installation
136
+
137
+ **Option 1: pipx (recommended for end users)**
138
+
139
+ `pipx` installs CLI tools into isolated environments and puts them on
140
+ your `PATH` — no virtualenv to activate, no `pip install` polluting
141
+ your global site-packages.
142
+
143
+ ```bash
144
+ pipx install agentchanti
145
+ agentchanti --help
146
+ ```
147
+
148
+ To upgrade later: `pipx upgrade agentchanti`. To install pre-release
149
+ builds straight from `main`: `pipx install
150
+ git+https://github.com/udaykanth/agentchanti.git`.
151
+
152
+ > **Note:** The package will be on PyPI once the first tagged release
153
+ > is cut. Until then, use Option 2 or 3 below.
154
+
155
+ **Option 2: Clone and install (for contributors / latest code)**
156
+
157
+ ```bash
158
+ git clone https://github.com/udaykanth/agentchanti.git
159
+ cd agentchanti
160
+
161
+ python3 -m venv .venv
162
+ source .venv/bin/activate # Linux/macOS
163
+ .venv\Scripts\activate # Windows
164
+
165
+ python -m pip install -e ".[dev]" # includes pytest + ruff for tests
166
+ agentchanti --help
167
+ ```
168
+
169
+ **Option 3: Convenience scripts**
170
+
171
+ If you'd rather not type the venv steps yourself, the repo ships
172
+ helper scripts that do the same thing:
173
+
174
+ ```bash
175
+ git clone https://github.com/udaykanth/agentchanti.git
176
+ cd agentchanti
177
+
178
+ # Linux / macOS
179
+ chmod +x install.sh && ./install.sh
180
+
181
+ # Windows
182
+ ./install.bat
183
+
184
+ source .venv/bin/activate # Linux/macOS
185
+ .venv\Scripts\activate # Windows
186
+ ```
187
+
188
+ > **Why no `curl | bash` installer?** AgentChanti is a Python package,
189
+ > not a single static binary. The standard Python tooling (`pipx`,
190
+ > `pip`) already handles isolated installs, version pinning, and
191
+ > upgrades — wrapping that in a shell script downloaded over HTTPS
192
+ > would add an attack surface without adding any value.
193
+
194
+ ---
195
+
196
+ ## Usage
197
+
198
+ ```bash
199
+ agentchanti "<task description>" [options]
200
+ ```
201
+
202
+ ### Quick Examples
203
+
204
+ ```bash
205
+ # With Ollama
206
+ agentchanti "Create a Flask REST API with CRUD" --provider ollama --model deepseek-coder-v2:16b
207
+
208
+ # With OpenAI
209
+ OPENAI_API_KEY="sk-..." agentchanti "Build a CLI tool" --provider openai --model gpt-4o-mini
210
+
211
+ # With Gemini
212
+ GEMINI_API_KEY="..." agentchanti "Build a REST API" --provider gemini --model gemini-2.5-flash
213
+
214
+ # With Claude
215
+ ANTHROPIC_API_KEY="sk-ant-..." agentchanti "Build a CLI tool" --provider anthropic --model claude-sonnet-4
216
+
217
+ # Non-interactive (CI/scripts)
218
+ agentchanti "Generate unit tests" --auto --no-git --no-report
219
+ ```
220
+
221
+ ### All Options
222
+
223
+ | Flag | Description | Default |
224
+ |------|-------------|---------|
225
+ | `"task"` | The coding task to perform (required) | — |
226
+ | `--prompt-from-file` | Read task description from a file | — |
227
+ | `--provider` | `ollama`, `lm_studio`, `openai`, `gemini`, `anthropic` | `lm_studio` |
228
+ | `--model` | Model name | `deepseek-coder-v2-lite-instruct` |
229
+ | `--embed-model` | Embedding model name | `nomic-embed-text` |
230
+ | `--language` | Override auto-detected language | auto-detect |
231
+ | `--config` | Path to `.agentchanti.yaml` config file | auto-discover |
232
+ | `--auto` | Non-interactive mode (auto-approve plan) | off |
233
+ | `--no-embeddings` | Disable semantic embeddings | off |
234
+ | `--no-stream` | Disable streaming responses | off |
235
+ | `--no-git` | Disable git checkpoint/rollback | off |
236
+ | `--no-diff` | Disable diff preview before writing | off |
237
+ | `--no-cache` | Disable step-level caching | off |
238
+ | `--clear-cache` | Clear step cache before running | off |
239
+ | `--no-knowledge` | Disable project knowledge base | off |
240
+ | `--no-search` | Disable web search agent | off |
241
+ | `--no-kb` | Disable KB context injection | off |
242
+ | `--report` / `--no-report` | Enable/disable HTML report | on |
243
+ | `--resume` | Force resume from checkpoint | off |
244
+ | `--fresh` | Ignore checkpoint, start fresh | off |
245
+ | `--generate-yaml` | Generate `.agentchanti.yaml` and exit | off |
246
+
247
+ ### Knowledge Base Commands
248
+
249
+ Manage the project knowledge base via `agentchanti kb`:
250
+
251
+ ```bash
252
+ agentchanti kb embed # Embed symbols into the vector store
253
+ agentchanti kb search "query" # Semantic search over KB
254
+ agentchanti kb query find-callers X # Find all callers of a function
255
+ agentchanti kb error-lookup "msg" # Look up error fixes
256
+ agentchanti kb health # Show KB health report
257
+ agentchanti kb update # Pull global KB updates
258
+ ```
259
+
260
+ See [documentation.md](documentation.md) for the full list of KB commands.
261
+
262
+ ---
263
+
264
+ ## Documentation
265
+
266
+ For full documentation including architecture details, configuration reference, library API, plugin system, and troubleshooting, see **[documentation.md](documentation.md)**.
267
+
268
+ ---
269
+
270
+ ## Contributing
271
+
272
+ Contributions are welcome! Feel free to open issues or submit pull requests.
273
+
274
+ 1. Fork the repository
275
+ 2. Create a feature branch (`git checkout -b feature/my-feature`)
276
+ 3. Run the tests: `python -m pytest tests/ -v`
277
+ 4. Commit and push
278
+ 5. Open a pull request
279
+
280
+ ---
281
+
282
+ ## License
283
+
284
+ MIT License. See [LICENSE](LICENSE) for details.
285
+
286
+ ---
287
+
288
+ ## Disclaimer
289
+
290
+ > **This is a personal project by [Uday Kanth](https://github.com/udaykanthr).** It is not affiliated with, endorsed by, sponsored by, or in any way officially connected with my current or past employer(s), or any of their subsidiaries, clients, or affiliates. All opinions, code, and design decisions in this project are my own and do not represent the views or intellectual property of any organization I am or have been associated with. This project was built entirely on my own time using my own resources.