Skip to content

israelolrunfemi/DevMind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevMind 🧠

DevMind is an autonomous multi-agent coding assistant built in Python. It takes a natural language task, breaks it into a structured plan, writes complete Python code, executes it in a sandboxed subprocess, and automatically debugs failures β€” all without human intervention. It can also scaffold entire multi-file projects, search the web for docs on the fly, and persist session history across runs. Built with FastAPI, Hugging Face Inference API (Qwen2.5-Coder-7B-Instruct), and a clean multi-agent architecture where every agent has a single responsibility.

Python FastAPI HuggingFace License

Architecture

User task
  |
  v
FastAPI /run
  |
  v
PlannerAgent -> numbered execution plan
  |
  v
CoderAgent -> complete Python script
  |
  v
ExecutorAgent -> sandboxed subprocess result
  |
  v
Retry loop with error feedback, max 3 attempts
devmind/
|-- main.py                  # FastAPI app entry point
|-- orchestrator.py          # Runs the full agent pipeline
|-- agents/
|   |-- __init__.py
|   |-- base_agent.py        # Base class all agents inherit from
|   |-- planner_agent.py     # Breaks task into a step-by-step plan
|   |-- coder_agent.py       # Writes Python code based on the plan
|   `-- executor_agent.py    # Runs code and returns result or error
|-- tools/
|   |-- __init__.py
|   |-- code_runner.py       # Executes Python code in a subprocess sandbox
|   |-- file_tools.py        # read_file, write_file
|   `-- package_installer.py # pip install missing packages
|-- config.py                # Config and constants
|-- schemas.py               # Pydantic models for requests/responses
|-- utils/
|   |-- __init__.py
|   |-- llm_client.py        # Async Hugging Face Inference API wrapper
|   `-- parser.py            # Parses LLM plans and code blocks
|-- .env.example
|-- requirements.txt
`-- README.md

Tech Stack

Layer Tool
Runtime Python 3.11+
Backend FastAPI
LLM Hugging Face Inference API
Model Qwen/Qwen2.5-Coder-7B-Instruct:nscale
Client huggingface_hub.InferenceClient
HTTP client httpx
Environment python-dotenv
Terminal output Rich
Execution subprocess
Validation Pydantic v2

Setup

git clone <repo-url>
cd devmind
python -m pip install -r requirements.txt
Copy-Item .env.example .env

Edit .env and set:

HF_TOKEN=your_token_here

Start the server:

python -m uvicorn main:app --reload

Endpoints

GET /health

Response:

{
  "status": "ok",
  "model": "Qwen/Qwen2.5-Coder-7B-Instruct:nscale"
}

POST /run

Request:

{
  "task": "Write a Python script that prints the first 10 Fibonacci numbers"
}

Response:

{
  "success": true,
  "plan": ["Understand the Fibonacci sequence requirement.", "Write a loop that produces 10 values.", "Print the values."],
  "code": "a, b = 0, 1\nfor _ in range(10):\n    print(a)\n    a, b = b, a + b",
  "output": "0\n1\n1\n2\n3\n5\n8\n13\n21\n34\n",
  "error": null,
  "attempts": 1
}

Agent Roles

PlannerAgent receives the raw user task, asks the LLM for a concise numbered plan, and returns parsed plan steps.

CoderAgent receives the plan and an optional previous execution error, asks the LLM for a complete Python script, and returns only the extracted code.

ExecutorAgent receives the code, runs it from an isolated temporary sandbox directory with a 15-second timeout, and returns a typed success or error result.

About

πŸ€– DevMind β€” Autonomous multi-agent Python coding assistant. Plans, writes, executes, and self-debugs code using a Planner β†’ Coder β†’ Executor pipeline. Features project scaffolding, persistent memory, real-time observability dashboard, and web search. Powered by Qwen2.5-Coder via Hugging Face.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors