v2.3.0 · Local Autonomous Agent

COGITO

AGENT

Think Continuously · Act Autonomously · Stay Private

持续思考 · 自主行动 · 数据私有

"Cogito, ergo sum — I think, therefore I am. CogitoAgent is not just a tool; it is your autonomous thinking partner running entirely in your local environment."

— CogitoAgent v2.3.0
GitHubGitHub GiteeGitee Issues反馈

Your Local AI Autonomous Agent您的本地 AI 自主智能体

CogitoAgent is a locally-run autonomous AI agent that integrates file management, knowledge mining, system operations, code execution, and web connectivity. It runs directly within the working directory you configure — with no need to upload files to third-party servers. CogitoAgent 是一款本地运行的自主 AI 智能体,集成了文件管理、知识挖掘、系统操作、代码执行、网络搜索等功能。它直接在您配置的工作目录内运行,无需将文件上传至第三方服务器。

Unlike traditional chatbots, CogitoAgent possesses the ability to Think Continuously, Explore Autonomously, and Execute Tools, capable of proactively discovering and organizing your local assets in the background. 与传统聊天机器人不同,CogitoAgent 拥有 持续思考自主探索工具执行 的能力,可以在后台主动发现和整理您的本地资源。

Continuous Thinking持续思考
Auto-triggers analysis every 3 seconds每3秒自动触发分析
Privacy First隐私优先
All data stays local, no uploads数据完全本地,无需上传
Rich Toolset丰富工具集
18 modules: files, code, Git, OCR, DB...18个模块:文件、代码、Git、OCR、数据库等
Persistent Memory持久记忆
Long-term storage, cross-session learning长期记忆存储,跨会话学习
cogito-agent
$ npm run electron
[think] Scanning workspace...
[think] Found 3 pending tasks
[think] Fetching latest updates...
Planning complete, awaiting instructions
[think] Loading persona: Default — your intelligent assistant
Agent ready. Type '/help' for available commands.
$
🤖 Hello! I'm CogitoAgent, your local autonomous AI assistant 🧠
I'm continuously thinking and exploring your workspace to help organize, analyze, and create.
💡 What can I do for you today? Try '/help' to see all available commands!
Desktop Preview桌面预览
CogitoAgent Electron Desktop
100+
Tool Functions工具函数
18
Tool Modules工具模块
22
Preset Personas预设人设
12
Quick Commands快捷指令
01

Supported Models支持模型

OpenAI (GPT-4o)
Moark
Anthropic (Claude)
Google (Gemini)
Ollama (Local)
OpenAI-Compatible API
02

Tool Modules工具模块

All tool functions are managed uniformly by registry.js and called using the [TOOL] functionName(args) [/TOOL] format. Tools are loaded on-demand by category. 所有工具函数由 registry.js 统一管理,使用 [TOOL] functionName(args) [/TOOL] 格式调用。工具按分类按需加载。

File Operations文件操作
ls, read, create, copy, mkdir, delete, rename
Web Tools网页工具
search, browse, fetchPage, searchOnEngine
Code Execution代码执行
JavaScript, Python, formatCode, executeFile
Git VCSGit 版本控制
commit, push, branch, checkout, diff, stash
Task Management任务管理
create, track, split, complete, stats
Memory System记忆系统
store, search, recall, stats, related
Database数据库
SQLite queries, transactions, schema
Image Recognition (OCR)图像识别 (OCR)
text extraction, batch processing
Vision Analysis视觉分析
image description, content understanding
Email邮件功能
text, HTML, attachments, templates
Scheduled Tasks定时任务
cron-style scheduling, toggle
System Monitor系统监控
CPU, memory, disk, processes
Browser Automation浏览器自动化
click, fill, screenshot, navigate
06

Feature Showcases功能展示

Explore the powerful features of CogitoAgent through these screenshots. 通过这些截图探索 CogitoAgent 的强大功能。

Dashboard Overview仪表盘概览
CogitoAgent Dashboard
Desktop Window桌面窗口
CogitoAgent Desktop
Web Search网络搜索
CogitoAgent Web Search
File Explorer文件浏览器
CogitoAgent File Explorer
Code Execution代码执行
CogitoAgent Code Execution
Run Application运行应用
CogitoAgent Run Application
07

Vision & OCR视觉与 OCR

CogitoAgent integrates advanced computer vision capabilities, enabling image analysis, OCR text extraction, and visual understanding. CogitoAgent 集成了先进的计算机视觉能力,支持图像分析、OCR 文本提取和视觉理解。

Vision Analysis视觉分析
CogitoAgent Vision Analysis
Analyze images for content description, object detection, scene understanding, and more using multi-modal AI models. 使用多模态 AI 模型分析图像内容描述、物体检测、场景理解等。
OCR RecognitionOCR 识别
CogitoAgent OCR
Extract text from images, screenshots, and documents. Support batch processing for multiple images. 从图像、截图和文档中提取文本。支持多图像批量处理。
// Example: Vision analysis
[TOOL] vision("screenshot.png", "Describe this image") [/TOOL]

// Example: OCR text extraction
[TOOL] ocr("document.png") [/TOOL]

// Example: Batch OCR
[TOOL] ocrBatch("img1.png, img2.png") [/TOOL]
03

Architecture架构设计

The Agent core runs a continuous thinking loop. After startup, it automatically triggers one thinking cycle every 3 seconds (configurable via thinkingInterval): build context → call API → parse output → execute tools → repeat. Agent 核心运行着一个持续思考循环。启动后每3秒自动触发一轮思考(可通过 thinkingInterval 配置):构建上下文 → 调用 API → 解析输出 → 执行工具 → 循环。

🧠
Thinking Loop思考循环
3s interval auto-trigger3秒间隔自动触发
⚙️
State Machine状态机
THINKING → AWAIT_INPUT → AWAIT_CONFIRM思考 → 等待输入 → 等待确认
🔌
Plugin System插件系统
Dynamic tool loading动态工具加载
🛡️
Sandbox Security沙箱安全
isolated-vm process isolationisolated-vm 进程隔离
📁
Multi-Session多会话管理
Persistent storage, context compression持久化存储,上下文压缩
🌐
MCP ProtocolMCP 协议
Model Context Protocol support模型上下文协议支持
04

Technical Details技术细节

🔄

State Machine状态机

Three core states managed by state.js with strict transitions. state.js 管理的三个核心状态,具有严格的状态转换。

// State transitions
AWAITING_INPUTTHINKING (user input)
THINKINGAWAITING_CONFIRMATION (dangerous tool)
THINKINGAWAITING_INPUT (response ready)
AWAITING_CONFIRMATIONTHINKING (confirmed)
🔌

Tool Registry工具注册表

Centralized tool management with metadata including category, parameters, danger level, and execution handler. 集中式工具管理,包含分类、参数、危险等级和执行句柄等元数据。

// Tool registration format
name: 'functionName',
description: 'description',
parameters: { /* JSON Schema */ },
category: 'file/code/git/...',
dangerLevel: 'none/low/medium/high'
🛡️

Security Sandbox安全沙箱

Process-level isolation using isolated-vm with deep-freezing of built-in objects and resource limits. 使用 isolated-vm 实现进程级隔离,内置对象深度冻结,资源使用受限。

// Sandbox security features
Deep freeze of built-in objects
No file system access
No network access
Execution timeout limit
Memory usage limit
📦

Context Compression上下文压缩

Auto-compression when conversation exceeds max length. Uses LLM to summarize early messages while keeping recent context. 当对话超过最大长度时自动压缩。使用 LLM 总结早期消息,保留最近上下文。

// Compression strategy
maxHistoryLength: 100 (messages)
compressThreshold: 80% of max
keepRecent: 20 latest messages
summarize: Early messages → summary
📈

Tracing & Retry追踪与重试

Lightweight observability with tracing.js and reliable network requests with retry.js using exponential backoff. 轻量级可观测性(tracing.js)和可靠网络请求(retry.js),支持指数退避策略。

// Retry configuration
maxAttempts: 3
delay: 1000ms
backoff: 'exponential'
retryOn: [Error, Timeout]
🌐

MCP ProtocolMCP 协议

Model Context Protocol support for integration with other AI clients. Exposes tools via JSON-RPC. 支持模型上下文协议(MCP),可与其他 AI 客户端集成。通过 JSON-RPC 暴露工具。

// MCP methods
tools/list - List all tools
tools/call - Invoke tool
resources/list - List resources
resources/read - Read resource

Thinking Cycle Workflow思考循环流程

01
Perceive Input感知输入
02
Build Prompt构建提示
03
Call LLM调用 LLM
04
Parse Response解析响应
05
Execute Tools执行工具
06
Update State更新状态

Auto-repeats every 3 seconds until response is ready (configurable via thinkingInterval) 每3秒自动重复,直到响应准备就绪(可通过 thinkingInterval 配置)

Project Structure项目结构

// Core files and their responsibilities

src/
├── agent/ // Agent core modules
│ ├── Agent.js // Thinking loop controller
│ ├── state.js // State machine management
│ ├── registry.js // Tool registration & discovery
│ ├── session.js // Multi-session management
│ ├── commands.js // Command handling (/help, /status, etc.)
│ ├── stats.js // Usage statistics & metrics
│ ├── tracing.js // Lightweight observability
│ ├── retry.js // Retry & circuit breaker
│ ├── mcp.js // MCP Server protocol
│ ├── plugin.js // Plugin system
│ └── tools/ // 18+ tool modules
├── api/ // API layer (client, models, webSearch)
├── io/ // Terminal, Logger, WebSocket
├── config.js // Configuration management
└── index.js // Application entry

electron/ // Desktop mode (Electron)
personas/ // 22 preset personas
data/ // Runtime data (auto-created)
05

Getting Started快速开始

CogitoAgent offers multiple operation modes to suit different environments and preferences. CogitoAgent 提供多种运行模式以适应不同环境和偏好。

🖥️ Desktop Mode🖥️ 桌面模式
Electron desktop window + terminal Agent, communicating via WebSocket (port 9527). Features a semi-transparent frosted glass dialog for seamless interaction. Electron 桌面窗口 + 终端 Agent,通过 WebSocket(端口 9527)通信。半透明毛玻璃对话框,实现无缝交互。
npm run electron:desktop
📊 Dashboard Mode📊 仪表盘模式
Full-window dashboard with session management, tool usage statistics, and real-time monitoring. 全屏仪表盘,包含会话管理、工具使用统计和实时监控。
npm run electron:dashboard
💻 CLI Mode💻 命令行模式
Pure command-line mode without Electron or WebSocket. Ideal for servers, remote connections, or resource-constrained environments. 纯命令行模式,无 Electron 或 WebSocket。适用于服务器、远程连接或资源受限环境。
npm run cli
🚀 Setup Wizard🚀 配置向导
Interactive setup wizard for first-time configuration: API settings, workspace path, and persona selection. 交互式配置向导,首次运行时引导完成:API 设置、工作区路径和人设选择。
npm start

On first run (npm start), the setup wizard will guide you through API configuration, workspace setup, and persona selection. 首次运行时(npm start),配置向导将引导您完成 API 配置、工作区设置和人设选择。

08

Quick Commands快捷指令

ENTER Interrupt thinking, enter command打断思考,输入指令
exit Exit program退出程序
/help Show help显示帮助
/status View status查看状态
/persona Switch persona切换人设
/personas List all personas列出所有人设
/tools List all tools查看所有工具
/config Show configuration查看配置
/sessions List all sessions列出所有会话
/new Create new session创建新会话
/switch Switch session切换会话
/clear Clear conversation清除对话

Ready to Get Started?准备好开始了吗?

Choose your preferred mode and let CogitoAgent work for you. 选择您喜欢的模式,让 CogitoAgent 为您工作。