Skip to content

iohub/codeactor-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

579 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎻 CodeActor β€” A Self-Evolving Multi-Agent AI Coding Engine

Not a copilot. A crew of autonomous agents that understand, navigate, and evolve your codebase β€” together.

CodeActor TUI CodeActor TUI


πŸ’‘ Why CodeActor?

Most AI coding tools share a fundamental flaw: they treat code as text, not structure.

Traditional Tools CodeActor
Flat text pattern matching 🧠 Structural code understanding via AST + call graphs + semantic vectors
Single agent, working alone πŸ€– Hub-and-Spoke multi-agent: Conductor orchestrates, six specialized agents execute
Static capabilities 🧬 Meta-Agent: designs & registers new agents at runtime β€” the system evolves
Keyword-only search πŸ” Natural-language semantic search β€” "find where auth logic is implemented"
No project memory πŸ“š Git Commit Learning: auto-learns commit history, injects relevant context

πŸ€– The Agent Team

Agent Role Core Capability
🎼 Conductor Orchestrator Task decomposition, dynamic planning, delegation, review
πŸ”¬ Repo-Agent Code Archaeologist AST parsing, semantic search, call graphs, code skeletons
✏️ Coding-Agent Staff Engineer 22+ tools, autonomous coding, self-correction
🌐 Browser-Agent Web Researcher Headless Chrome, page navigation, data extraction
πŸ”§ DevOps-Agent SRE Shell execution, environment diagnostics, process management
πŸ’¬ Chat-Agent Technical Advisor General Q&A, technical explanations
🧬 Meta-Agent Agent Factory Runtime agent design & registration

πŸ—οΈ Architecture

User Interface (TUI / HTTP+WebSocket)
            β”‚
     🎼 Conductor
     Task Decomposition Β· Dynamic Planning Β· Review
            β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚        β”‚        β”‚        β”‚        β”‚        β”‚
πŸ”¬Repo   ✏️Coding  πŸ’¬Chat   πŸ”§DevOps 🌐Browser 🧬Meta
Code Intel  Editing  Q&A     Shell    Web     Agent
(Rust)    (22 tools)         Ops     Research Factory

Full architecture docs β†’


⚑ Four Core Differentiators

🧠 1. Rust-Powered Deep Code Intelligence

The Repo-Agent is backed by a Rust engine with Tree-sitter AST parsing, LanceDB vector embeddings, and Petgraph call-graph analysis. It understands code like a senior engineer β€” cross-file impact analysis, cycle detection, semantic search.

  • 7 language ASTs: Rust Β· Python Β· JavaScript Β· TypeScript Β· Java Β· C++ Β· Go
  • Semantic search: find code by meaning, not keywords
  • Call graph analysis: real-time "who calls this function?" and "what will this change break?"
  • Auto-indexing: file watcher with 20s debounce keeps the model in sync

🧬 2. Meta-Agent: Self-Evolving at Runtime

This is CodeActor's most unique capability. When the Conductor encounters a task beyond built-in agents, the Meta-Agent:

  1. 🎨 Designs β€” auto-generates a new agent's system prompt and toolset
  2. ⚑ Executes β€” immediately runs the new agent to complete the task
  3. πŸ”§ Registers β€” permanently adds it to the available tool pool

Example: auto-creates delegate_security_auditor for full-repo security audits, or delegate_performance_profiler for bottleneck analysis.

🌐 3. Browser-Agent: Autonomous Web Research

Built-in headless Chrome (go-rod) navigates the web autonomously β€” documentation, GitHub issues, Stack Overflow. When local context is insufficient, the Conductor delegates web research automatically.

"Find the latest FastAPI middleware docs and summarize CORS setup" β€” without leaving the terminal.

πŸ“š 4. Git Commit Learning: Project Memory

Automatically fetches recent commits β†’ LLM generates structured summaries β†’ LanceDB vector storage β†’ semantic matching on user queries β†’ relevant history auto-injected into context. The AI always knows your project's latest evolution.


πŸ”¬ 5. Hybrid Retrieval + Code Graph Expansion: From "Found" to "Understood"

Traditional code search tells you where keywords match. CodeActor finds the code, then automatically analyzes the structural world around it.

🎯 Three-Stage Cascading Retrieval Pipeline

User Query
    β”‚
    β”œβ”€β†’ Stage 1: Hybrid Search (Dual-Channel High Recall)
    β”‚   β”œβ”€β”€ 🧠 Dense: LanceDB Vector Search (Qwen3-Embedding-4B, 2560-dim)
    β”‚   └── πŸ”€ Sparse: Tantivy BM25 Full-Text Search (CodeTokenizer for snake_case/CamelCase)
    β”‚   └── πŸ”— RRF Fusion: Reciprocal Rank Fusion merges both channels
    β”‚
    β”œβ”€β†’ Stage 2: Code Graph Expansion (Structural Context Injection)
    β”‚   └── PetCodeGraph BFS Traversal: from seed functions, auto-expand callers/callees
    β”‚   └── Cross-file context: place isolated code blocks back into their architectural position
    β”‚
    └─→ Stage 3: Cross-Encoder Rerank (Precision Refinement)
        └── Optional Reranker API for Query-Document cross-encoding rerank

Why This Matters

Pure vector search treats code blocks as isolated islands β€” it computes semantic similarity but has no idea what the function calls, who calls it, or what module it belongs to.

CodeActor's breakthrough: Hybrid retrieval + code graph expansion = a leap from "found" to "understood".

Aspect Pure Vector Search CodeActor Hybrid + Graph Expansion
Recall ❌ Semantic matches with different keywords β†’ missed βœ… BM25 + Vector dual-channel covers both semantics and exact match
Precision ❌ Short text / noise often ranks high βœ… RRF fusion + short-code penalty + Cross-Encoder triple filtering
Context ❌ Returns isolated code blocks with no call relationships βœ… PetCodeGraph auto-expands call chains, restores architectural context
Code-Aware ❌ Generic tokenizers don't understand code naming βœ… Custom CodeTokenizer designed for snake_case & CamelCase
Robustness ❌ Single point of failure βœ… Triple degradation: BM25 failsβ†’dense-only, Reranker failsβ†’RRF, one channelβ†’other

πŸ› οΈ Developer Experience

  • Dual interfaces: TUI terminal mode (Bubble Tea) + HTTP/WebSocket API server
  • 13+ LLM providers: OpenAI, DeepSeek, Alibaba Qwen, Moonshot, AWS Bedrock... switch with one config line
  • Streaming output: watch agents think and act in real-time
  • Context compression engine: automatic token budget management for long sessions
  • Security sandbox: WorkspaceGuard boundary enforcement + dangerous command interception + user confirmation pipeline

πŸš€ Quick Start

Prerequisites

  • Go 1.24+
  • ripgrep (full-text regex search)

Install

git clone https://github.com/your-org/codeactor-agent.git
cd codeactor-agent
go build -o codeactor .

Configure

Create ~/.codeactor/config/config.toml:

[global.llm]
use_provider = "siliconflow"

[global.llm.providers.siliconflow]
model = "deepseek-ai/DeepSeek-V3.2"
api_base_url = "https://api.siliconflow.cn/v1"
api_key = "your-api-key"
temperature = 0.0
max_tokens = 23000

Run

# TUI mode
./codeactor tui

# With a task file
./codeactor tui --taskfile TASK.md

# HTTP server mode (default :9080)
./codeactor http

Node.js CLI Client

cd clients/nodejs-cli && npm install
node index.js run <project-dir> "your task description"
node index.js chat <task-id> <project-dir>     # continue conversation

πŸ“– Documentation

Document Description
ARCHITECTURE.md System architecture, modules, data flow
Agent_Design.md Multi-agent design rationale
Agent_Reference.md API reference & configuration
Browser_Agent_Design.md Browser agent architecture

🀝 Community & Contributing

We welcome all contributions β€” bug reports, feature requests, docs, and code.


πŸ“„ License

Apache License 2.0

Releases

No releases published

Packages

 
 
 

Contributors