Professional Local autonomous coding agent powered by Ollama
Project description
๐ง DevAgent
A Lightweight Local Open-Source Miniature of Claude Code CLI
A production-grade local coding agent that finds bugs, writes patches, reviews its own code, and validates with tests โ all offline, all local, zero API costs.
Quick Start โข Architecture โข Benchmarks โข Roadmap โข Contributing
๐ค Why DevAgent?
Most AI coding tools are chatbots โ they suggest code, you copy-paste, you pray.
DevAgent is a real agent with a retrieval-first, tool-grounded architecture:
| Chatbot | DevAgent | |
|---|---|---|
| Searches your codebase | โ | โ ripgrep + semantic search |
| Retrieves relevant code | โ | โ FAISS embeddings |
| Plans before coding | โ | โ Planner layer |
| Generates patches | โ | โ Unified diffs |
| Reviews its own output | โ | โ Self-critique loop |
| Runs your tests | โ | โ pytest integration |
| Retries on failure | โ | โ Up to N iterations |
| Works in sandbox | โ | โ Isolated workspace |
| Works offline | โ | โ 100% local via Ollama |
| Costs money | ๐ธ | โ Free forever |
Philosophy: Execution > Reasoning. Tools > Hallucination. Retrieval > Huge Context. Reliability > Intelligence.
โจ Features
๐ ReAct Loop โ Thought โ Action โ Observation โ Fix โ Review โ Test cycle
๐ง Planner โ LLM generates an action plan before coding
๐ Semantic Search โ FAISS + sentence-transformers code retrieval
๐ Code Search โ ripgrep-powered with cross-platform fallback
๐ Self-Review โ LLM critiques its own fixes, revises until approved
๐ฉน Patch Engine โ Line-level unified diffs instead of full file rewrites
๐งช Test-Driven โ Runs pytest after every fix, retries on failure
๐๏ธ Sandbox Mode โ Agent works in an isolated copy, applies changes only on success
๐ Benchmarks โ 5 built-in benchmark suites with automated evaluation
๐ Metrics โ Latency, token estimates, retries, and performance tracking
๐ Full Audit Trail โ Every step logged to logs/run.json
๐ 100% Offline โ Runs on Ollama with small models (2-4 GB)
โก Low Resource โ Works on RTX 3050 (4 GB VRAM) / 16 GB RAM
๐ Quick Start
Prerequisites
- Python 3.11+
- Ollama installed and running
Install & Setup
# 1. Clone
git clone https://github.com/VedantJadhav701/Developer-Code-Intelligence-Agent.git
cd Developer-Code-Intelligence-Agent
# 2. Install
pip install devagent-cli # (Coming soon to PyPI)
# Or locally: pip install -e .
# 3. Verify System (CRITICAL)
# This checks your Python environment, Ollama connection, and dependencies
devagent doctor
# 4. Pull the model
ollama pull qwen2.5-coder:3b
# 5. Run!
devagent run --task "Fix the divide-by-zero bug" --root ./demo_project
CLI Subcommands
| Command | Description |
|---|---|
devagent run |
Execute a coding task on a project |
devagent benchmark |
Run the automated benchmark suite |
devagent doctor |
Check system health and dependencies |
devagent models |
List available Ollama models |
devagent version |
Show current version |
๐ก๏ธ Reliability & Safety (v3.2.1+)
DevAgent is built for Enterprise-grade safety:
- Dry Run Mode: Use
--dry-runto see what the agent would do without touching your files. - Auto-Snapshot: Creates a safety restore point before every run.
- Rollback: Revert the last agent changes instantly with
devagent rollback. - Forensic Test Detection: Detects successful test runs even in noisy environments.
- Path Anchoring: Automatically corrects "root hallucinations" for subdirectories.
๐น๏ธ Interactive Mode
Run with --interactive (or -i) to review colorized diffs before they are applied to your project.
devagent run --task "Fix bug" --interactive
๐๏ธ Architecture
graph TD
CLI[DevAgent CLI] --> Orchestrator[ReAct Orchestrator]
Orchestrator --> Safety[Safety Manager: Snapshots]
Orchestrator --> Memory[Working Memory]
Orchestrator --> Retrieval[Semantic Retrieval FAISS]
Orchestrator --> Tools[Tool Suite: pytest, ripgrep, git]
Orchestrator --> Reviewer[Self-Review Loop]
Reviewer --> Patch[Surgical Patch Engine]
Patch --> Sandbox[Sandbox Environment]
No API keys. No sign-ups. No cloud.
Optional: Enable Semantic Search
pip install faiss-cpu sentence-transformers
Without these, DevAgent falls back to keyword search โ still fully functional.
๐ฌ Demo
____ _ _
| _ \ _____ __/ \ __ _ ___ _ __ | |_
| | | |/ _ \ \ / / _ \ / _` |/ _ \ '_ \| __|
| |_| | __/\ V / ___ \ (_| | __/ | | | |_
|____/ \___| \_/_/ \_\__, |\___|_| |_|\__|
|___/
+==========================================================+
| DEVELOPER CODE INTELLIGENCE AGENT |
| Model: qwen2.5-coder:3b |
| Sandbox: OFF |
+==========================================================+
[PLAN] LIKELY_FILES: calculator.py
1. search_code: divide
2. read_file: calculator.py
3. run_tests
----------------------------------------
ITERATION 1/5
----------------------------------------
[TOOL] Executing: search_code(divide)
>> Found: calculator.py:10:def divide(a, b)
[REVIEW] #1: APPROVED
>> Tests: 5 passed โ
[OK] AGENT COMPLETED SUCCESSFULLY
Status: success
Steps used: 1/5
Patches: 1
Time: 8.2s
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CLI (main.py) โ
โ --task --root --model โ
โ --sandbox --benchmark โ
โ --auto-commit --auto-push โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ
โ Planner Layer โ
โ Identifies files + strategy โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ
โ Retrieval Layer (Memory) โ
โ FAISS + Sentence-Transformersโ
โ Chunk โ Embed โ Top-K โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ
โ ReAct Agent Loop โ
โ โ
โ 1. THOUGHT (LLM) โ
โ 2. ACTION (Tool) โ
โ 3. OBSERVATION โ
โ 4. FIX (LLM) โ
โ 5. REVIEW (LLM) โ
โ 6. PATCH (Diff Engine) โ
โ 7. TEST (pytest) โ
โ โ
โ if FAIL โ retry โ
โ if PASS โ done โ โ
โโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ
โโโโโโโโโโผโโโ โโโโโโโโผโโโโโโโ
โ Tools โ โ Ollama โ
โ โ โ (Local) โ
โ โข search โ โ โ
โ โข semanticโ โ qwen2.5- โ
โ โข read โ โ coder:3b โ
โ โข patch โ โ phi3:mini โ
โ โข pytest โ โ mistral:7b โ
โ โข flake8 โ โ โ
โ โข git_diffโ โโโโโโโโโโโโโโโ
โ โข sandbox โ
โโโโโโโโโโโโโ
9-Layer Architecture
| Layer | Module | Purpose |
|---|---|---|
| 1. CLI | main.py |
Argument parsing, mode selection, banner |
| 2. Planner | app/planner.py |
Task interpretation, file identification |
| 3. Retrieval | app/memory.py |
FAISS index, semantic chunking, Top-K search |
| 4. Tools | tools/* |
8 real tools: search, semantic_search, read, write, test, lint, git, sandbox |
| 5. Agent | app/agent.py |
ReAct orchestration loop |
| 6. Review | app/reviewer.py |
Self-critique with APPROVED/REVISE |
| 7. Validation | tools/test_runner.py |
pytest + flake8 execution feedback |
| 8. Logging | utils/logger.py |
Structured JSON audit trail |
| 9. Safety | app/sandbox.py |
Isolated workspace, path validation |
๐ Project Structure
Developer-Code-Intelligence-Agent/
โโโ app/
โ โโโ agent.py # Core ReAct agent engine
โ โโโ planner.py # Task planning layer
โ โโโ reviewer.py # Self-review module
โ โโโ llm.py # Ollama integration
โ โโโ memory.py # FAISS retrieval + working memory
โ โโโ patcher.py # Unified diff patch engine
โ โโโ sandbox.py # Sandbox workspace manager
โ โโโ state.py # Shared state dataclass
โโโ tools/
โ โโโ search.py # Code search (ripgrep + fallbacks)
โ โโโ semantic_search.py # FAISS semantic search
โ โโโ file_ops.py # Safe file read/write
โ โโโ test_runner.py # pytest runner
โ โโโ linter.py # flake8 linter
โ โโโ git_tools.py # Git diff/commit/push
โ โโโ benchmark_runner.py # Benchmark evaluation
โโโ utils/
โ โโโ logger.py # Structured JSON logger
โ โโโ config.py # Centralized configuration
โ โโโ metrics.py # Performance metrics
โโโ benchmarks/
โ โโโ divide_by_zero/ # Benchmark: zero division guard
โ โโโ missing_validation/ # Benchmark: input validation
โ โโโ syntax_error/ # Benchmark: syntax fix
โ โโโ import_bug/ # Benchmark: wrong import
โ โโโ edge_case/ # Benchmark: empty list handling
โโโ demo_project/ # Sample buggy project
โโโ docs/
โ โโโ USER_GUIDE.md # Full usage guide
โโโ main.py # CLI entry point
โโโ devagent.py # Global CLI wrapper
โโโ devagent.bat # Windows global shortcut
โโโ requirements.txt
โโโ CONTRIBUTING.md
โโโ CHANGELOG.md
โโโ CODE_OF_CONDUCT.md
โโโ SECURITY.md
โโโ LICENSE
โโโ README.md
๐ป CLI Reference
python main.py --task "TASK" --root ./project [OPTIONS]
| Flag | Default | Description |
|---|---|---|
--task, -t |
(required) | The coding task for the agent |
--root, -r |
. |
Project root directory |
--model |
qwen2.5-coder:3b |
Any Ollama model |
--max-steps, -m |
5 |
Max ReAct iterations |
--benchmark |
off | Run benchmark suite |
--sandbox |
off | Run in isolated sandbox |
--auto-commit |
off | Git commit on success |
--auto-push |
off | Git push after commit |
--verbose, -v |
off | Verbose output |
Examples
# Fix a specific bug
python main.py -t "Fix the TypeError in user_service.py" -r ./backend
# Run in sandbox mode (safe โ doesn't touch real files until success)
python main.py -t "Fix divide-by-zero bug" -r ./project --sandbox
# Auto-commit changes on success
python main.py -t "Add input validation" -r ./api --auto-commit
# Use a stronger model
python main.py -t "Refactor auth middleware" -r ./server --model mistral:7b
# Run benchmarks
python main.py --benchmark
# More retries for complex tasks
python main.py -t "Make all tests pass" -r ./project --max-steps 10
๐ Full User Guide โ
๐ Benchmarks
DevAgent includes 5 built-in benchmarks to evaluate agent performance:
| Benchmark | Bug Type | Difficulty |
|---|---|---|
divide_by_zero |
Missing guard clause | Easy |
missing_validation |
No input validation | Medium |
syntax_error |
Broken syntax | Medium |
import_bug |
Wrong module name | Easy |
edge_case |
Empty list crash | Medium |
Run benchmarks:
python main.py --benchmark
python main.py --benchmark --model phi3:mini
๐ง Supported Models
| Model | Size | Speed | Quality | Best For |
|---|---|---|---|---|
qwen2.5-coder:3b |
1.9 GB | โก Fast | โ โ โ โ | Default โ best for code |
qwen2.5:3b |
1.9 GB | โก Fast | โ โ โ โ | General fallback |
phi3:mini |
2.2 GB | โก Fast | โ โ โ โ | Good reasoning |
qwen3:4b |
2.5 GB | โก Fast | โ โ โ โ | Better understanding |
gemma2:2b |
1.6 GB | โกโก | โ โ โโ | Ultra-low resource |
mistral:7b |
4.4 GB | ๐ข | โ โ โ โ โ | Best quality (8GB+ RAM) |
๐บ๏ธ Roadmap
โ Completed (v2.0)
- Core ReAct agent loop
- Self-review module
- Tool system (9 tools)
- Planner layer
- Semantic retrieval (FAISS)
- Patch engine (unified diffs)
- Sandbox mode
- Benchmark system (5 suites)
- Metrics + structured logging
- Git integration
- CLI with all flags
๐ Coming Next
- Multi-file support โ Agent works across multiple files simultaneously
- Language support โ JavaScript, TypeScript, Go, Rust
- Plugin system โ Custom tools via YAML/Python
- Watch mode โ Auto-fix on test failure (
--watch) - VS Code extension โ Run agent from your editor
- Conversation memory โ Learn from past runs
- Multi-agent mode โ Planner + Coder + Reviewer + Evaluator agents
๐ค Contributing
We welcome contributions! See CONTRIBUTING.md for details.
git checkout -b feature/your-feature
# ... make changes ...
python -m pytest demo_project/ -v
git commit -m "feat: your feature"
git push origin feature/your-feature
Good first issues are tagged and waiting: Browse good first issues โ
๐ License
MIT โ use it however you want. See LICENSE.
โญ Star History
If DevAgent helps you, give it a star! It helps others discover the project.
Built with ๐ง by Vedant Jadhav
A lightweight local open-source miniature of Claude Code CLI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devagent_cli-3.2.2.tar.gz.
File metadata
- Download URL: devagent_cli-3.2.2.tar.gz
- Upload date:
- Size: 43.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30dfc65539a9c7729832e6adb6631770e253d9252cfd2d6126025fe707d695a1
|
|
| MD5 |
e6dd76c45d667e7081958d6f15a04e71
|
|
| BLAKE2b-256 |
3a5c229bc400bdc59efe55a69db9fc65cbaaf0dd14230799ebfe387d4ce5f388
|
Provenance
The following attestation bundles were made for devagent_cli-3.2.2.tar.gz:
Publisher:
publish.yml on VedantJadhav701/Developer-Code-Intelligence-Agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devagent_cli-3.2.2.tar.gz -
Subject digest:
30dfc65539a9c7729832e6adb6631770e253d9252cfd2d6126025fe707d695a1 - Sigstore transparency entry: 1448067517
- Sigstore integration time:
-
Permalink:
VedantJadhav701/Developer-Code-Intelligence-Agent@08ad89e2fcc6204491f5b44cca0af71c37eab365 -
Branch / Tag:
refs/tags/v3.2.2 - Owner: https://github.com/VedantJadhav701
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@08ad89e2fcc6204491f5b44cca0af71c37eab365 -
Trigger Event:
push
-
Statement type:
File details
Details for the file devagent_cli-3.2.2-py3-none-any.whl.
File metadata
- Download URL: devagent_cli-3.2.2-py3-none-any.whl
- Upload date:
- Size: 46.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58d6b116fbad5b6d848b40c35d3bf340eb3576d428195d185d27500309d23754
|
|
| MD5 |
21c7b1e79b69ee2ee9b4a1da24da3c0d
|
|
| BLAKE2b-256 |
2fe40a3e88a070c1d24a17ec88a39ab1435bd5faf72f304cfe200ead2c8b0827
|
Provenance
The following attestation bundles were made for devagent_cli-3.2.2-py3-none-any.whl:
Publisher:
publish.yml on VedantJadhav701/Developer-Code-Intelligence-Agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devagent_cli-3.2.2-py3-none-any.whl -
Subject digest:
58d6b116fbad5b6d848b40c35d3bf340eb3576d428195d185d27500309d23754 - Sigstore transparency entry: 1448067569
- Sigstore integration time:
-
Permalink:
VedantJadhav701/Developer-Code-Intelligence-Agent@08ad89e2fcc6204491f5b44cca0af71c37eab365 -
Branch / Tag:
refs/tags/v3.2.2 - Owner: https://github.com/VedantJadhav701
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@08ad89e2fcc6204491f5b44cca0af71c37eab365 -
Trigger Event:
push
-
Statement type: