Skip to content

SquashyHydra/AI-Assistant

Repository files navigation

Local AI Assistant/Agent

A lightweight, Windows-first AI agent framework that can automate and assist with tasks on your PC. It is designed to be extensible: you can add new "skills" and capabilities over time, and it keeps its own state (chat history, system prompt, app aliases, and indexed files) so it can improve over time.

⚠️ This is an early-stage project. The agent can already chat, call applications, and remember aliases, but the file-search/indexing and self-updating behavior are still rough and should be improved for reliability.


✅ What it does

  • Maintains a chat history so the AI can refer back to recent conversations.
  • Indexes files and folders on your PC so it can locate and launch applications.
  • Stores application aliases (e.g., chrome, notepad) so you can reference apps using natural names.
  • Supports a workspace skill to manage and interact with project folders (list/search/read/edit files, switch workspaces).
  • Allows the AI to update its own system prompt and aliases via simple JSON files.

🧰 Requirements

  • Windows 10/11 (tested)
  • Python 3.11+ (3.12 should also work)
  • Basic familiarity with running Python scripts from a command line

🚀 Installation

  1. Clone or download this repository to a folder on your Windows PC.
  2. Open a PowerShell window and cd into the repository folder.
  3. Create and activate a Python virtual environment (recommended):
python -m venv .env
.\.env\Scripts\Activate.ps1
  1. Install dependencies:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

▶️ Running the Assistant

The main entry point is chat_model.py.

python chat_model.py

This will start the assistant in a console-based chat loop where you can type instructions and receive responses.


⚙️ Configuration & Data

System prompt

The system prompt is stored in:

  • agent_data/system_prompt.json

Edit this file to change the agent's behavior and personality.

App aliases

The assistant saves app aliases here:

  • agent_data/app_aliases.json

You can add or update aliases directly in this file. Example:

{
  "chrome": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
}

Chat history

Chat history is stored as a JSONL file:

  • agent_data/chat_history.jsonl

This file is updated automatically as you interact with the assistant.

Workspace / Project files (Workspace Skill)

The assistant has a built-in workspace skill that treats a folder as its active working space. It can:

  • List files in the workspace
  • Search for files by name
  • Read, create, append, or delete files in the workspace
  • Change the active workspace folder (useful when working across projects)

Workspace-related behavior is driven by trigger phrases. These are stored in:

  • agent_data/workspace_change_triggers.json

This file lists phrases that tell the assistant you want to switch workspaces (e.g., "change workspace", "open folder"). You can edit or extend these phrases to improve the assistant's understanding.


🧩 How it works (high-level)

  • The assistant uses a local language model (configured in chat_model.py) to generate responses.
  • It indexes the file system to locate executables and scripts so it can run them on your behalf.
  • It stores state (chat, aliases, prompts) in agent_data/ so it can remember information between runs.

🛠️ Extending the Agent

To add new capabilities:

  1. Inspect assistant_core/ to see how the agent is structured.
  2. Add new commands or tools by modifying assistant_core/apps.py and assistant_core/chat_runtime.py.
  3. Update data files under agent_data/ as needed.

🧠 Notes / Known Limitations

  • File indexing is basic and can miss apps on the system; improving or replacing the index/search logic is recommended.
  • The agent is not yet great at reliably updating its own prompt & aliases; manual edits are usually safer.
  • This is a local-only assistant; it does not send data to external APIs unless you configure it to do so.

📌 Tips

  • If you want faster startup, keep agent_data/computer_index.json up to date (it stores the file index).
  • If the assistant behaves unexpectedly, try clearing or editing agent_data/system_prompt.json and agent_data/app_aliases.json.

About

A lightweight, Windows-first AI agent framework that can automate and assist with tasks on your PC. It is designed to be extensible: you can add new "skills" and capabilities over time, and it keeps its own state so it can improve over time.

Topics

Resources

Stars

Watchers

Forks

Contributors