Seeking feedback on the architecture of a local-first, self-coding AI assistant

1 kentedwin 0 8/16/2025, 8:00:31 PM
I'm working on a prototype for a fully offline, voice-first assistant that can safely modify its own code using Abstract Syntax Tree (AST) editing. The goal is to create a private, extensible, and self-maintaining tool for developers.

The code isn't public yet (it's a 1-week prototype), but I'd love this community's feedback on the concept, architecture, and potential pitfalls.

My main questions are:

Viability: Any obvious dead-ends with using AST for safe, programmatic self-improvement?

Features: What critical developer-focused feature is missing?

Appeal: Is a local-first, self-refactoring agent a tool you would actually use?

Project Summary: Nerion

Nerion is an innovative local assistant designed to operate entirely offline, prioritizing user privacy and control. Its key feature is the ability to safely improve and modify its own code through AST editing, ensuring robust and secure self-coding. It's a modular platform that runs independently of cloud services.

Core Features

Offline & Private: Voice-first interaction (STT/TTS) and all logic runs 100% locally.

AST-Based Self-Coding Engine: Programmatically modifies code structure, not just text. This is the core of its refactoring and self-improvement capabilities.

Natural Language Planner: Translates instructions like "add logging to all functions in core/" into AST action plans.

Proactive Self-Improvement: Uses static analysis (pylint, flake8, radon) to find code issues and automatically generates AST plans to fix them.

Automated Testing & Refactoring: Includes CLI tools for multi-file batch operations, advanced code renaming/refactoring, and automatically generating/running unit tests from a plan.

Safety & Reliability

Safety & Rollback Guard: Automatically snapshots the codebase before applying any changes. If a post-change healthcheck fails, it automatically rolls back.

AutoTest Guard: Ensures that any newly generated unit tests pass before changes are finalized.

Self-Aware Coverage: Integrates coverage.py to ensure that code modifications don't decrease test coverage.

Interface

Voice & Chat: Supports Push-to-Talk (PTT) and Voice Activity Detection (VAD) modes. Also has an integrated terminal chat input for non-voice interaction.

Developer-Focused CLI: A comprehensive command-line interface for managing every aspect of the system, from running healthchecks to applying code modifications. All tools support JSON output for scripting.

Example Commands

Translate a natural language request into an AST plan and apply it $ nerion plan -i "add a try/except wrapper to all service functions" --apply

Scan the codebase, find issues, and generate a plan to fix them $ nerion self-improve scan --paths app core $ nerion self-improve plan out/analysis_reports/report.json

Safely refactor an attribute name across the entire project $ nerion rename --root src/ --old old.mod.thing --new new.mod.widget --apply

Comments (0)

No comments yet