Skip to main content

EdgeMind V1.0.3

Resource-Aware Agentic Coding Assistant for Local AI Software Engineering

"Building autonomous software engineering agents that run entirely on local consumer hardware."

Python LangGraph Ollama SQLite License Platform


๐Ÿ“– Problem Statement & Motivation

Modern AI coding assistants heavily rely on expensive cloud infrastructure, exposing proprietary code bases to third-party servers, incurring high latency, and requiring constant internet connectivity. Conversely, running autonomous coding agents locally on consumer hardware presents distinct challenges: limited system RAM, constrained compute, dynamic local model availability, and potential hallucinations or syntax errors.

EdgeMind resolves these challenges by combining:

  • Edge AI & Local Inference: Powered by local Ollama LLMs with zero data leaving your machine.
  • Intent-Driven Dual Routing: Distinguishes execution requests from conversational discussions and follow-ups.
  • Agentic LangGraph Workflows: Multi-step graph orchestration with autonomous file discovery, structured planning, disk inspection, and retry recovery.
  • Resource-Aware Dynamic Model Router: Automatically detects installed local models and matches tasks to available models without forcing unnecessary multi-GB downloads.
  • Hardened Multi-Layer Verification: AST syntax parsing, atomic disk writes, path security boundaries, and automatic backup preservation.

โœจ Core Features

  • ๐Ÿง  Context-Aware Intent Routing: Automatically classifies queries into EXECUTION (graph workflow), FOLLOW_UP (read-only change explanation), or CONVERSATIONAL (pair-programming mode).
  • โšก Real-Time Activity Event Streaming: Live progress events (โ— Understanding request..., โœ“ Found bad.java, โ†’ Analyze โ†’ Edit, โœ“ Syntax valid) streamed directly to the CLI interface.
  • ๐Ÿค– Intelligent Local Model Manager: Auto-discovers installed Ollama models (qwen2.5-coder, codellama, deepseek-coder, phi3, llama3), using available models without mandatory downloads.
  • ๐Ÿ› ๏ธ Autonomous Code Creation & Modification: Intelligently infers whether to create new files (e.g. bad.java โ†’ bad.py) or modify existing source files in-place.
  • ๐Ÿ›ก๏ธ Hardened Verification & Safety: Disk-level post-write inspection, AST syntax validation, path traversal protection, and automatic backup directory isolation (.edgemind/backups/).
  • ๐Ÿ—‚๏ธ Enriched SQLite Session Memory: Persists execution requests, plans, diffs, analysis findings, and verification results across interactive turns in ~/.edgemind/edgemind.db.

๐Ÿ—๏ธ System Architecture

alt text


๐Ÿค– Model & Ollama Architecture

EdgeMind uses a resource-aware model manager and router (app/models/model_router.py) that categorizes installed local Ollama models:

  • Coding Workloads (edit, modify, create, debug, deployment): Dynamically routes to installed coding models matching coder, code, starcoder, deepseek-coder, codellama, or qwen2.5-coder. Fallback default: qwen2.5-coder:3b.
  • Conversational & Planning Workloads (planner, search, explain, conversational, follow_up): Dynamically routes to installed general models matching phi3, llama3, mistral, gemma, or qwen. Fallback default: phi3:mini.
  • First-Run Resource Awareness: Evaluates available system RAM via psutil. If no model is installed, recommends resource-appropriate fallbacks (qwen2.5-coder:3b for $\ge 4\text{ GB RAM}$) and prompts before pulling.

๐Ÿ—‚๏ธ Dual-Layer Memory Architecture

  1. Short-Term Session Context (SessionState): Tracks working directory, active file, active model, turn history, and pronoun references (it, that, this file) in-memory.
  2. Persistent SQLite Memory (task_history): Stored at ~/.edgemind/edgemind.db. Records:
    • Project absolute path & query string
    • Executed plan JSON & tool task names
    • Source/target file paths & operation mode (create vs modify)
    • Truncated result output & generated unified diffs
    • Execution success and verification status

๐Ÿ› ๏ธ Intelligent Code Editing & Safety Mechanisms

  • Edit Preview Generation: EditingService.prepare_edit() generates modified code, parses AST/delimiters, and computes unified diffs before disk write.
  • Atomic File Writing: FileManager.write_file() writes generated content to a temporary file in the target directory and replaces the destination atomically (Path.replace()), preserving file permission flags.
  • Security Path Traversal Boundary: validate_project_path() rejects file operations outside project root boundaries or in forbidden directories (.git, .venv, node_modules).
  • Backup Isolation: Automatically copies modified files into .edgemind/backups/, preserving relative directory hierarchy for instant rollback support.

โš™๏ธ Installation & Setup

Option 1: Install via PyPI

pip install edgemind

To upgrade an existing installation:

pip install -U edgemind

Launch the interactive CLI shell:

edgemind

Option 2: Install from Source

git clone https://github.com/Akhilesh-Venkiteswaran/EdgeMind.git
cd EdgeMind
python3 -m venv venv
source venv/bin/activate
pip install -e .

๐Ÿš€ Prerequisites & Model Setup

  1. Install Ollama: Download from https://ollama.com and ensure ollama is in your system PATH.
  2. Start Ollama Daemon:
    ollama serve
    
  3. Pull Recommended Local Model:
    ollama pull qwen2.5-coder:3b
    

๐Ÿ’ก Usage Examples

Interactive CLI Shell

Launch the shell:

edgemind

Example 1: Code Conversion (File Creation)

EdgeMind > Convert bad.java to Python
  โ— Understanding request...
  โ— Identifying source file...
  โœ“ Found bad.java
  โ— Determining requested operation...
  โ†’ Analyze โ†’ Edit
  โ— Creating execution plan...
  โœ“ 2 tasks planned
  โ— Generating Python implementation...
  โœ“ Generated bad.py
  โ— Validating generated code...
  โœ“ Python syntax valid
  โ— Reviewing changes...
  โœ“ Source preserved

Files Status:
  Created  : bad.py (NEW FILE)
  Modified : None
  Preserved: bad.java (UNTOUCHED)

Validation & Review:
  โœ“ Source file preserved: /path/to/bad.java
  โœ“ Target file created: /path/to/bad.py
  โœ“ Syntax validation passed: Validation Passed

Example 2: Follow-Up Questions

EdgeMind > What did you change?
  โ— Understanding request...
  โ— Loading previous execution context...
  โœ“ Found 1 significant change.
  โ— Reviewing the changes made...

EdgeMind:
I converted bad.java into bad.py:
- Transformed Java class structure into idiomatic Python functions.
- Converted standard I/O calls to native print statements.
- Added type hints and docstrings.
No additional files were modified.

Example 3: Single-Shot Subcommands

# Analyze project structure and resources
edgemind analyze .

# Explain a specific source file
edgemind explain app/models/model_router.py

# Analyze an error log or traceback
edgemind debug tests/sample_error.txt

# Generate Dockerfile
edgemind generate-docker .

# Generate requirements.txt
edgemind generate-requirements .

# Generate docker-compose.yml
edgemind generate-compose .

๐Ÿ“‚ Project Structure

EdgeMind/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ cli/             # Interactive shell, banner, commands, main Typer CLI
โ”‚   โ”œโ”€โ”€ editing/         # Editing service, file manager, modifier, validator, diffs
โ”‚   โ”œโ”€โ”€ events/          # Real-time activity streaming event system
โ”‚   โ”œโ”€โ”€ graph/           # LangGraph nodes, planner V2, state schema, workflow compilation
โ”‚   โ”œโ”€โ”€ memory/          # SQLite database schema, connections, memory manager
โ”‚   โ”œโ”€โ”€ models/          # Model manager, resource-aware router, Ollama client
โ”‚   โ”œโ”€โ”€ resources/       # System resource monitor (psutil CPU/RAM)
โ”‚   โ”œโ”€โ”€ routing/         # Intent router & conversational/follow-up handlers
โ”‚   โ”œโ”€โ”€ scripts/         # Graph export utilities
โ”‚   โ”œโ”€โ”€ setup/           # Prerequisites check & setup wizard
โ”‚   โ””โ”€โ”€ tools/           # Autonomous file discovery, scanner, analyzer, generators
โ”œโ”€โ”€ tests/               # Unit, adversarial, agentic, and integration test suite
โ”œโ”€โ”€ .github/workflows/   # CI/CD and automated PyPI release workflows
โ”œโ”€โ”€ ARCHITECTURE.md      # Detailed system architecture blueprint
โ”œโ”€โ”€ FUNCTION_REFERENCE.md# Complete technical function and class reference
โ”œโ”€โ”€ WORKFLOWS.md         # Workflow sequence diagrams and call-flow documentation
โ””โ”€โ”€ pyproject.toml       # Package configuration & PyPI release metadata

๐Ÿงช Development & Testing

Running Tests

Execute deterministic unit tests (no active Ollama server required):

pytest -m "not ollama" -v

Execute live Ollama integration tests:

pytest -m ollama -v

Execute complete test suite (all 40+ tests):

pytest -v

๐Ÿ“ฆ Building Package & PyPI Release Infrastructure

EdgeMind utilizes standard Python setuptools packaging defined in pyproject.toml.

Building Package Distribution

pip install build twine
python -m build

PyPI Automated Release Workflow

Automated releases are managed via GitHub Actions (.github/workflows/release.yml) using PyPI Trusted Publishing. Pushing a tag formatted v*.*.* automatically triggers build and publication to PyPI.


โš ๏ธ Current Limitations

  1. Local Model Dependency: Requires an installed local Ollama binary and at least one LLM model.
  2. Single-File Edit Scopes: Active code modification step operates on one primary file per step; complex multi-file refactoring runs sequentially across graph steps.
  3. Language Syntax Checking: AST-based syntax checking is fully deterministic for Python and JSON; structural delimiter checks are enforced for Java, C++, JS, and TS (with node -c invoked if Node.js is installed).

๐Ÿ—บ๏ธ Future Roadmap

  • ๐Ÿ› ๏ธ Multi-File Simultaneous Refactoring: Enhanced graph nodes for concurrent multi-file edit previewing.
  • ๐Ÿงช Automated Test Execution Node: Native execution node for running pytest inside isolated sandbox containers.
  • ๐Ÿ“Š Model Benchmarking Subsystem: Automated benchmark suite evaluating local LLM accuracy across code edit tasks.

๐Ÿ“œ License

MIT License. Free for open-source and commercial use.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edgemind-1.0.3.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edgemind-1.0.3-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

Details for the file edgemind-1.0.3.tar.gz.

File metadata

  • Download URL: edgemind-1.0.3.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for edgemind-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9c6b4b92b5b37133b9c73a0f3db0f4e18ec81bbefdd8209b1f6ec18082431e59
MD5 8cf3e95738696e779be3791c005be09c
BLAKE2b-256 d052d54a33e9cead7bb3d139ee8efadce1a606b0b55d0168ceb6e11210a7b57b

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgemind-1.0.3.tar.gz:

Publisher: release.yml on DarkFoot101/EdgeMind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file edgemind-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: edgemind-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 56.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for edgemind-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 128d0eeafe455276aaac8fa066824115ca2e7c7641bd90c689c8fdeab25db309
MD5 e70cc36ff5eda683e636ca8d055dd035
BLAKE2b-256 dbb37049e454ab0f9703e36606a666c5b503b9048ea02ec028fbbca2a5cd99d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgemind-1.0.3-py3-none-any.whl:

Publisher: release.yml on DarkFoot101/EdgeMind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.0.4

2 files

This release

1.0.3 This release

2 files

1.0.2

2 files

1.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page