Skip to content

Cyberpunk-themed AI file management assistant built with Blazor & Semantic Kernel. Chat with a local LLM to read, write, and manage files using natural language.

Notifications You must be signed in to change notification settings

DevMando/temuCowork

Repository files navigation

TemuCowork Agent

TemuCowork Agent is an AI-powered file management assistant with a cyberpunk aesthetic. Built with .NET 8 Blazor and Microsoft Semantic Kernel, it connects to locally-running Ollama models to provide an intelligent agent that can read, write, search, and manage files through natural language conversation. Features include real-time streaming responses, @ file mentions with autocomplete, multi-format file reading (PDF, Excel, code files), persistent chat sessions, and a stunning neon-glow UI theme.

.NET 8 Blazor Ollama License

Features

AI-Powered File Operations

  • Natural Language Commands - Ask the agent to create, read, edit, or delete files using plain English
  • Multi-Format Support - Reads .txt, .md, .json, .xml, .csv, .pdf, .xlsx, and 15+ code file formats
  • Smart File Search - Recursive file search with real-time filtering
  • Sandboxed Operations - All file operations are restricted to a configurable root directory

Interactive Chat Interface

  • Real-Time Streaming - Watch responses stream in as the AI generates them
  • Agent Status Indicators - Visual feedback showing thinking, function calls, and writing states
  • Function Execution Tracking - See exactly which operations the agent performs
  • @ Mention Files - Type @ to get autocomplete suggestions for referencing files in your messages
  • File Attachments - Attach files from the file browser to include their contents in your message

Session Management

  • Persistent Conversations - All chats are saved and can be resumed later
  • Session History - Browse, rename, and delete past conversations
  • LiteDB Storage - Lightweight embedded database for reliable storage

Cyberpunk UI Theme

  • Neon Glow Effects - Matrix-inspired green and cyan color palette
  • Custom Fonts - Orbitron, Rajdhani, and Share Tech Mono
  • Smooth Animations - Pulse, glow, and slide effects throughout
  • Three-Panel Layout - File browser, chat, and sessions in one view

Screenshots

┌─────────────────────────────────────────────────────────────────────┐
│  [Files]              [Chat]                        [Sessions]      │
│  ├── TemuCowork/      ┌─────────────────────────┐   ├── Chat 1     │
│  │   ├── Services/    │ You: Read the config    │   ├── Chat 2     │
│  │   ├── Models/      │                         │   └── Chat 3     │
│  │   └── ...          │ Agent: [Thinking...]    │                   │
│  └── ...              │ ► ReadFile executed     │                   │
│                       │                         │                   │
│  [+ New] [Refresh]    │ Here's the content...   │   [+ New Chat]   │
│                       └─────────────────────────┘                   │
│                       [@mention] [Send] [Attach]                    │
└─────────────────────────────────────────────────────────────────────┘

Requirements

Quick Start

1. Install Ollama and Pull a Model

# Install Ollama from https://ollama.ai/
# Then pull a model:
ollama pull qwen2.5:14b

2. Clone and Run

git clone https://github.com/yourusername/TemuCowork.git
cd TemuCowork/TemuCowork
dotnet run

3. Open in Browser

Navigate to https://localhost:5001 or http://localhost:5000

Configuration

Edit appsettings.json to customize:

{
  "Ollama": {
    "Endpoint": "http://localhost:11434",
    "DefaultModel": "qwen2.5:14b",
    "Temperature": 0.7,
    "MaxTokens": 4096
  },
  "FileSystem": {
    "RootPath": "C:\\Users\\YourName\\Projects"
  },
  "LiteDb": {
    "DatabasePath": "Data/conversations.db"
  }
}

Or use the in-app Configuration page to:

  • Change the Ollama endpoint
  • Select from available models
  • Adjust temperature and token limits
  • Test the connection

Usage Examples

Reading Files

"Read the Program.cs file and explain what it does"

Creating Files

"Create a new file called notes.md with a summary of today's meeting"

Searching Files

"Find all JSON files in the project"

Editing Files

"Add a comment at the top of FileSystemService.cs explaining its purpose"

File Mentions

Type @ in the chat to get autocomplete suggestions:

"Compare @config.json with @config.backup.json and tell me the differences"

Project Structure

TemuCowork/
├── Components/
│   ├── Pages/
│   │   ├── Home.razor          # Main chat interface
│   │   ├── Configuration.razor # Settings page
│   │   └── Sessions.razor      # Session history
│   └── Layout/
│       └── MainLayout.razor    # Navigation layout
├── Services/
│   ├── FileSystemService.cs    # File operations
│   ├── FileReaderService.cs    # Multi-format file reading
│   ├── ConversationService.cs  # Session persistence
│   └── SemanticKernelService.cs# AI orchestration
├── Models/
│   ├── ChatMessage.cs          # Chat message model
│   ├── Conversation.cs         # Session model
│   ├── FileItem.cs             # File tree item
│   └── AgentStatus.cs          # Agent state tracking
├── Plugins/
│   └── FileSystemPlugin.cs     # SK functions for file ops
├── wwwroot/
│   └── app.css                 # Cyberpunk theme styles
├── Program.cs                  # App configuration
└── appsettings.json            # Settings

Technology Stack

Component Technology
Framework .NET 8.0, Blazor Server
UI Components Radzen.Blazor
AI Orchestration Microsoft Semantic Kernel
LLM Backend Ollama (local inference)
Database LiteDB
PDF Processing PdfPig
Excel Processing EPPlus
Markdown Markdig

Agent Capabilities

The AI agent can perform these file system operations:

Function Description
ReadFile Read text, PDF, or Excel files
WriteFile Create or overwrite files
ListDirectory List folder contents
CreateFolder Create new directories
DeleteFile Delete files
DeleteFolder Delete directories recursively
RenameItem Rename files or folders
GetFileInfo Get file metadata (size, dates)

Security

  • Path Sandboxing - All operations are restricted to the configured root path
  • Path Validation - Every file operation validates paths to prevent directory traversal
  • Graceful Error Handling - Unauthorized access attempts are caught and reported

Troubleshooting

"Failed to initialize AI"

  • Ensure Ollama is running: ollama serve
  • Check the endpoint in Configuration matches your Ollama server
  • Verify the model is downloaded: ollama list

"Connection refused"

  • Default Ollama port is 11434
  • Check firewall settings if running Ollama on a different machine

Files not appearing

  • Verify the FileSystem:RootPath in appsettings.json exists
  • Check read permissions on the directory

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Cyberpunk-themed AI file management assistant built with Blazor & Semantic Kernel. Chat with a local LLM to read, write, and manage files using natural language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published