A powerful conversational AI agent that interacts with your file system using DeepSeek's API. Features persistent memory, multi-turn conversations, and real-time streaming responses.
- Session-based conversations - Agent remembers context across interactions
- File system memory - Tracks files it has seen, their sizes, and metadata
- User notes - Agent can store and recall important information
- Disk persistence - Conversations survive browser refreshes and server restarts
- Tool history - Tracks all actions taken during a session
- Maintains conversation context across multiple exchanges
- References previous interactions naturally
- Understands follow-up questions and clarifications
- Example: "Remember my config file path" โ "What was that config path again?"
- Read - View contents of any text file
- Write - Create or overwrite files with content
- Create directories - Build folder structures
- Delete - Remove files or empty directories
- Move/Rename - Organize files and folders
- List directory - Explore folder contents
- File info - View size, creation/modification dates
- Search - Find files by pattern or content
fetch_url- Fetch any URL (web pages, APIs, text files)fetch_and_parse_json- Fetch and parse JSON APIs automaticallydownload_file- Download and save files from the web
pg_query- Execute any SQL query with parameterizationpg_list_tables- List all tables with metadatapg_describe_table- Get detailed table schemapg_get_schema- Export full database schemapg_generate_data- Generate random test datapg_table_stats- Get table statistics and metricspg_create_table- Create new tablespg_alter_table- Modify existing tablespg_drop_table- Delete tables (with caution)pg_list_indexes- Show indexes on tablespg_list_foreign_keys- Show relationshipspg_list_sequences- List sequencespg_transaction- Atomic multi-query transactions
git_init- Initialize new repositorygit_status- Show current stategit_add- Stage filesgit_commit- Commit with messagegit_branches- List branchesgit_create_branch- Create new branchgit_checkout- Switch branchesgit_delete_branch- Delete branchesgit_log- View historygit_diff- See changesgit_reset_hard- Discard changesgit_reset_soft- Unstage changesgit_revert- Undo commit safelygit_stash- Save changes temporarilygit_stash_pop- Restore stashed changesgit_merge- Merge branchesgit_file_history- File historygit_uncommitted_files- List changed filesgit_create_tag- Create tagsgit_tags- List tags
- Real-time streaming - Watch the agent think and act step-by-step
- Natural language - Describe what you want in plain English
- Path safety - Prevents directory traversal attacks
- Error handling - Clear feedback when something goes wrong
- Progress tracking - See step counts, tool usage, and elapsed time
remember_note- Store important informationrecall_notes- Retrieve previously stored notessearch_files- Find files by name pattern- File tracking - Automatically remembers files it encounters
- Clean, modern chat interface
- Real-time streaming output
- Session management (new chat, clear history)
- Example prompts for quick testing
- Memory statistics (files seen, notes, actions)
- Keyboard shortcuts (Enter to send)
- Node.js (v16 or higher)
- DeepSeek API key (Get one here)
# Clone or create the project
mkdir mecha-ui
cd mecha-ui
# Install dependencies
npm install
# Create .env file with your API key
echo "DEEPSEEK_API_KEY=your-deepseek-key-here" > .env
echo "DEEPSEEK_MODEL=deepseek-chat" >> .env
echo "WORKSPACE_DIR=./workspace" >> .env
# Create workspace folder
mkdir -p apps
# Start the server
npm start- Open
localhost:3000in your browser - Type a command in the chat input
- Watch the agent process your request in real-time
- Continue the conversation - the agent remembers context!
User: "Create a folder called 'project' and add a README.md"
Agent: โ
Created directory: project
โ
Wrote project/README.md (48 characters)
User: "Remember that my config is in ./config/settings.json"
Agent: ๐ญ Remembered: "config is in ./config/settings.json"
User: "Where is my config file?"
Agent: You asked me to remember that your config is at ./config/settings.json.
Would you like me to read it?
User: "Get weather data from the OpenWeatherMap API"
Agent: ๐ Fetching API data...
๐ Weather: Sunny, 22ยฐC
๐พ Saved to: weather.json
Explore Database:
User: "What tables are in the database?"
Agent: ๐ Tables in public (12):
๐ users (8 columns)
๐ products (6 columns)
๐ orders (7 columns)
Custom Queries:
User: "Find all orders over $1000 from the last month"
Agent: ๐ Executing SQL query...
โ
Found 43 orders
User: "Find all JavaScript files, check if they have tests"
Agent: ๐ Searching for *.js files...
Found 3 JS files
๐ Reading app.js...
๐ Reading utils.js...
๐ Reading test.js...
Initialize and commit:
User: "Initialize git and commit all files"
Agent: โ
Repo initialized
โ
Committed: Initial commit
Feature branch workflow:
User: "Create feature branch, add code, merge"
Agent: ๐ฟ Created branch: feature/new
โ
Committed changes
๐ Merged to main
Safe undo:
User: "Revert the last commit"
Agent: โ
Reverted commit safely
๐ New commit created
Browser (UI)
โ
HTTP/SSE
โ
Express Server
โ
DeepSeek Agent
โโโ Session Manager
โ โโโ Conversation History
โ โโโ File Memory
โ โโโ User Notes
โโโ Tool Executor
โ โโโ File Operations
โ โโโ Memory Operations
โโโ File System (./workspace)
- Path traversal protection - Agent cannot access files outside the workspace
- Sandboxed workspace - All operations confined to
./workspacedirectory - Input validation - All user inputs are validated before processing
- Rate limiting - Prevents excessive API usage
- Session timeout - Inactive sessions expire automatically
express- Web serverejs- Template renderingopenai- DeepSeek API client (OpenAI-compatible)
mecha-ui/
โโโ server.js # Express server with endpoints
โโโ agent-memory.js # DeepSeek agent with memory
โโโ session-manager.js # Session and memory management
โโโ index.html # Frontend UI
โโโ package.json # Dependencies and scripts
โโโ .env # Configuration
โโโ workspace/ # Agent's sandboxed file system
โ โโโ .memory/ # Persistent session storage
โโโ README.md # This file
| Endpoint | Method | Description |
|---|---|---|
/api/execute-stream |
POST | Execute a command with streaming response |
/api/session/:sessionId |
GET | Get session information |
/api/sessions |
GET | List all active sessions |
/api/session/:sessionId |
DELETE | Delete a specific session |
/api/sessions |
DELETE | Clear all sessions |
Edit .env:
DEEPSEEK_MODEL=deepseek-reasoner # For complex reasoning tasksEdit session-manager.js:
const MAX_HISTORY_TURNS = 100; // Keep more conversation historyEdit .env:
WORKSPACE_DIR=/path/to/your/folder- ๐ก Running - Agent is processing your request
- ๐ข Done - Task completed successfully
- โช Idle - Waiting for input
Using DeepSeek makes this agent extremely cost-effective:
- DeepSeek-Chat: ~$0.14 per 1M input tokens
- DeepSeek-Reasoner: ~$0.55 per 1M input tokens
- Typical request cost: < $0.001 per interaction
- Check your
.envfile - Ensure
DEEPSEEK_API_KEYstarts withsk- - Visit DeepSeek Platform to verify your key
- Ensure server is running (
npm start) - Check port 3000 is not in use
- Verify browser can access
http://localhost:3000
- Wait a few seconds and try again
- Consider upgrading your DeepSeek plan
- Ensure operations are within
./apps - Check file/folder permissions
- Verify paths are relative to workspace
- Semantic search with embeddings
- Multi-file operations with pattern matching
- File watching and auto-reactions
- Visual file explorer
- Batch operation scheduling
- Export/Import conversation history
- Voice input support
- Integration with version control (Git)
GPL
This agent has file system access. Always:
- Use a dedicated workspace folder
- Never point it to system-critical directories
- Review all operations before executing
- Keep backups of important data
Built with โค๏ธ using DeepSeek API
