How app0lyon/mycodex works
MyCodex is a local coding copilot: a user submits a goal through the VS Code chat or backend API/CLI; the agent gathers workspace context, plans and executes tasks, reviews and corrects results, then returns a response. The repository also documents prompt-only optimization, session memory, local search, and an optional NVIDIA provider. The agent’s orchestrator coordinates the workflow; the VS Code extension provides the chat and transport. Some connections are supported by the SOURCE INDEX or README rather than complete source excerpts.
Main entry points: orchestrator.py Workflow orchestrator · ollama_client.py Ollama client · executor.py Code executor · reviewer.py Task reviewer
Components 30
VS Code chat
- Extension commands
vscode-extension/mycodex/src/extension.ts - Chat panel
vscode-extension/mycodex/src/panel.ts - Chat interface
vscode-extension/mycodex/src/webview/html.ts - Webview messaging
vscode-extension/mycodex/src/webview/messaging.ts - Request transport
vscode-extension/mycodex/src/backend.ts - Workspace utilities
vscode-extension/mycodex/src/utils/workspace.ts
Agent entry
- API and CLI
agent/main.py
Task workflow
- Workflow orchestrator
agent/orchestrator.py - Prompt optimizer
agent/agents/prompt_optimizer.py - Task planner
agent/agents/planner.py - Task models
agent/models/tasks.py - Code executor
agent/agents/executor.py - Task reviewer
agent/agents/reviewer.py - Final critic
agent/agents/critic.py - Self correction
agent/agents/self_correction.py - Final responder
agent/agents/responder.py
Context and state
- Workspace search
agent/agents/searcher.py - Workspace context
agent/utils/workspace_context.py - Workspace patching
agent/utils/workspace_patcher.py - Session memory
agent/utils/memory.py - Prompt templates
agent/prompts - Prompt renderer
agent/utils/prompt_renderer.py - Cost logging
agent/utils/cost_logger.py
Models and services
- Ollama client
agent/clients/ollama_client.py - NVIDIA client
agent/clients/nvidia_build_client.py - Search client
agent/clients/search_client.py - Ollama service
- NVIDIA Build
- DuckDuckGo API
Other components
- User
Connections 42
- User → Extension commands: opens chat
README.md - Extension commands → Chat panel: opens panel
vscode-extension/mycodex/src/extension.ts - Chat panel → Chat interface: renders
vscode-extension/mycodex/src/panel.ts - Chat panel → Webview messaging: uses
vscode-extension/mycodex/src/panel.ts - Webview messaging → Request transport: sends requests
vscode-extension/mycodex/src/webview/messaging.ts - Webview messaging → Workspace utilities: reads workspace
vscode-extension/mycodex/src/webview/messaging.ts - Request transport → API and CLI: calls API or CLI
README.md - User → API and CLI: submits goal
README.md - API and CLI → Workflow orchestrator: runs workflow
agent/main.py - API and CLI → Session memory: configures memory
agent/main.py - Workflow orchestrator → Prompt optimizer: optimizes prompt
agent/orchestrator.py - Workflow orchestrator → Task planner: plans tasks
agent/orchestrator.py - Workflow orchestrator → Code executor: executes tasks
agent/orchestrator.py - Workflow orchestrator → Task reviewer: reviews tasks
agent/orchestrator.py - Workflow orchestrator → Final critic: evaluates results
agent/orchestrator.py - Workflow orchestrator → Self correction: corrects results
agent/orchestrator.py - Workflow orchestrator → Final responder: builds response
agent/orchestrator.py - Workflow orchestrator → Workspace search: searches workspace
agent/orchestrator.py - Workflow orchestrator → Workspace context: gathers context
agent/orchestrator.py - Workflow orchestrator → Workspace patching: applies edits
agent/orchestrator.py - Workflow orchestrator → Session memory: uses session memory
agent/orchestrator.py - Task planner → Task models: creates tasks
agent/agents/planner.py - Code executor → Task models: parses output
agent/agents/executor.py - Task reviewer → Task models: parses review
agent/agents/reviewer.py - Code executor → Ollama client: requests completion
agent/agents/executor.py - Task reviewer → Ollama client: requests review
agent/agents/reviewer.py - Task planner → Ollama client: requests plan
agent/agents/planner.py - Prompt optimizer → Ollama client: requests rewrite
agent/agents/prompt_optimizer.py - Final responder → Ollama client: requests response
agent/agents/responder.py - Final critic → Ollama client: requests critique
agent/agents/critic.py - Self correction → Ollama client: requests correction
agent/agents/self_correction.py - Workspace search → Search client: searches web
agent/agents/searcher.py - Code executor → Prompt renderer: renders prompt
agent/agents/executor.py - Task reviewer → Prompt renderer: renders prompt
agent/agents/reviewer.py - Code executor → Prompt templates: uses templates
agent/agents/executor.py - Task reviewer → Prompt templates: uses templates
agent/agents/reviewer.py - Ollama client → Ollama service: sends chat
agent/clients/ollama_client.py - NVIDIA client → NVIDIA Build: sends chat
agent/clients/nvidia_build_client.py - Workflow orchestrator → NVIDIA client: selects provider
agent/orchestrator.py - Search client → DuckDuckGo API: queries
agent/clients/search_client.py - Ollama client → Cost logging: logs usage
agent/clients/ollama_client.py - NVIDIA client → Cost logging: logs usage
agent/clients/nvidia_build_client.py