updated readme with new todos, minor css tweak
This commit is contained in:
292
readme.md
292
readme.md
@@ -1,262 +1,30 @@
|
|||||||
# ⚡ JarvisChat v1.4.0
|
# JarvisChat TODO
|
||||||
|
|
||||||

|
## Current Tasks
|
||||||
|
|
||||||
**A lightweight Ollama coding companion with persistent memory, web search, and real-time system monitoring.**
|
1. Verify SearXNG and Docker services persist across reboots
|
||||||
|
- Expand refusal patterns: "As an AI model", "based on my training data", "I don't have the capability"
|
||||||
Built with FastAPI + SQLite + Jinja2. Runs on Python 3.13. No Docker required.
|
2. Conversation search/filter by keyword
|
||||||
|
3. Export conversation to markdown/text
|
||||||
## What's New in v1.4.0
|
4. Keyboard shortcuts (Ctrl+N new chat, Ctrl+Enter send)
|
||||||
|
5. Retry button on assistant messages
|
||||||
- **FTS5 Memory System**: Say "remember that..." to store facts — they're automatically retrieved by relevance and injected into context
|
6. Source links — clickable links when search used
|
||||||
- **Forget Command**: Say "forget about..." to remove memories
|
7. Allow conversation renaming
|
||||||
- **Memory Toggle**: Enable/disable memory injection from topbar or settings
|
8. Multiple profiles — coding/sysadmin/general
|
||||||
- **Multi-file Structure**: Backend and frontend separated for easier maintenance
|
9. Auto-generate conversation tags (client-side KWIC, top 5, filterable badges)
|
||||||
|
10. Image input support — pull vision model, file input/drag-drop, base64 encode, pass `images` array to Ollama `/api/chat`
|
||||||
## Features
|
11. Split-screen option for btop display
|
||||||
|
12. Skills as markdown files — `/opt/jarvischat/skills/`, YAML frontmatter + instructions, injected into context for tool calls
|
||||||
- **Persistent Memory** — SQLite FTS5 full-text search for fast, relevant memory retrieval
|
13. Heartbeats / proactive check-ins — cron + endpoint for daily briefings, HA anomaly alerts
|
||||||
- **Web Search** — SearXNG integration for automatic web lookups when the model is uncertain
|
14. Model info button — (i) icon next to Model dropdown, shows div with model description, last updated date, best-use purpose
|
||||||
- **Profile Injection** — Custom system prompt injected into every conversation
|
15. Set default model — toggle any model as the default selection
|
||||||
- **System Presets** — Save and switch between different system prompts
|
16. Hide/remove model from list — exclude models from dropdown
|
||||||
- **Real-time Stats** — CPU, RAM, GPU, VRAM monitoring in sidebar
|
17. Update model function — trigger `ollama pull` for selected model from UI
|
||||||
- **Token Thermometer** — Visual context window usage indicator
|
18. Add mouseover tooltip to SEND button
|
||||||
- **Streaming Responses** — Server-sent events for real-time token display
|
|
||||||
- **Conversation History** — SQLite-backed chat persistence with mass-delete option
|
## Completed
|
||||||
- **Model Switching** — Change Ollama models on the fly
|
|
||||||
|
- ✓ Explicit web search button + orange styling (v1.5.0)
|
||||||
## File Structure
|
- ✓ Add `profile.example.md` (v1.4.0)
|
||||||
|
- ✓ Mass-delete conversation history (v1.3.0)
|
||||||
```
|
- ✓ Token count estimate before sending (v1.2.9)
|
||||||
/opt/jarvischat/
|
|
||||||
├── app.py # FastAPI backend
|
|
||||||
├── jarvischat.db # SQLite database (auto-created)
|
|
||||||
├── static/
|
|
||||||
│ └── logo.png # Logo image (optional)
|
|
||||||
└── templates/
|
|
||||||
└── index.html # Frontend
|
|
||||||
```
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- Python 3.11+ (tested on 3.13)
|
|
||||||
- Ollama running locally or on network
|
|
||||||
- SearXNG (optional, for web search)
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### Fresh Install
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Create directory and venv
|
|
||||||
sudo mkdir -p /opt/jarvischat
|
|
||||||
sudo chown $USER:$USER /opt/jarvischat
|
|
||||||
cd /opt/jarvischat
|
|
||||||
python3 -m venv venv
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
./venv/bin/pip install fastapi uvicorn httpx psutil jinja2 python-multipart
|
|
||||||
|
|
||||||
# Create subdirectories
|
|
||||||
mkdir -p templates static
|
|
||||||
|
|
||||||
# Copy files
|
|
||||||
# (copy app.py to /opt/jarvischat/)
|
|
||||||
# (copy index.html to /opt/jarvischat/templates/)
|
|
||||||
# (copy logo.png to /opt/jarvischat/static/ — optional)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Upgrading from v1.3.x
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd /opt/jarvischat
|
|
||||||
|
|
||||||
# Backup
|
|
||||||
cp app.py app.py.bak
|
|
||||||
|
|
||||||
# Install new dependency
|
|
||||||
./venv/bin/pip install jinja2
|
|
||||||
|
|
||||||
# Create new directories
|
|
||||||
mkdir -p templates static
|
|
||||||
|
|
||||||
# Copy new files
|
|
||||||
# (copy app.py, replacing old version)
|
|
||||||
# (copy index.html to templates/)
|
|
||||||
|
|
||||||
# Restart
|
|
||||||
sudo systemctl restart jarvischat
|
|
||||||
```
|
|
||||||
|
|
||||||
## Systemd Service
|
|
||||||
|
|
||||||
Create `/etc/systemd/system/jarvischat.service`:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[Unit]
|
|
||||||
Description=JarvisChat - Local Ollama Web Interface
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=jarvischat
|
|
||||||
Group=jarvischat
|
|
||||||
WorkingDirectory=/opt/jarvischat
|
|
||||||
ExecStart=/opt/jarvischat/venv/bin/uvicorn app:app --host 0.0.0.0 --port 8080
|
|
||||||
Restart=always
|
|
||||||
RestartSec=5
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable jarvischat
|
|
||||||
sudo systemctl start jarvischat
|
|
||||||
```
|
|
||||||
|
|
||||||
## Memory Commands
|
|
||||||
|
|
||||||
In chat, natural language triggers memory operations:
|
|
||||||
|
|
||||||
| You say | What happens |
|
|
||||||
|---------|--------------|
|
|
||||||
| "remember that I prefer Rust over Go" | Stores as `preference` |
|
|
||||||
| "remember that JarvisChat runs on port 8080" | Stores as `infrastructure` |
|
|
||||||
| "note that the deadline is Friday" | Stores as `general` |
|
|
||||||
| "forget about the deadline" | Removes matching memories |
|
|
||||||
|
|
||||||
Memories are automatically searched based on your message content and injected into the system prompt when relevant.
|
|
||||||
|
|
||||||
### Memory Topics
|
|
||||||
|
|
||||||
Memories are auto-categorized:
|
|
||||||
- `preference` — likes, dislikes, choices
|
|
||||||
- `project` — active work, repos, tasks
|
|
||||||
- `infrastructure` — servers, services, configs
|
|
||||||
- `personal` — name, location, background
|
|
||||||
- `general` — everything else
|
|
||||||
|
|
||||||
## API Endpoints
|
|
||||||
|
|
||||||
### Memory
|
|
||||||
|
|
||||||
| Method | Endpoint | Description |
|
|
||||||
|--------|----------|-------------|
|
|
||||||
| GET | `/api/memories` | List all memories |
|
|
||||||
| POST | `/api/memories` | Add memory `{"fact": "...", "topic": "general"}` |
|
|
||||||
| DELETE | `/api/memories/{rowid}` | Delete memory by ID |
|
|
||||||
| GET | `/api/memories/search?q=term` | Search memories |
|
|
||||||
| GET | `/api/memories/stats` | Get counts by topic |
|
|
||||||
|
|
||||||
### Chat & Models
|
|
||||||
|
|
||||||
| Method | Endpoint | Description |
|
|
||||||
|--------|----------|-------------|
|
|
||||||
| GET | `/api/models` | List available Ollama models |
|
|
||||||
| POST | `/api/chat` | Send message (streaming SSE) |
|
|
||||||
| POST | `/api/show` | Get model info (context size) |
|
|
||||||
| GET | `/api/ps` | Get running models |
|
|
||||||
|
|
||||||
### Settings & Profile
|
|
||||||
|
|
||||||
| Method | Endpoint | Description |
|
|
||||||
|--------|----------|-------------|
|
|
||||||
| GET | `/api/profile` | Get profile content |
|
|
||||||
| PUT | `/api/profile` | Update profile |
|
|
||||||
| GET | `/api/profile/default` | Get default profile |
|
|
||||||
| GET | `/api/settings` | Get settings |
|
|
||||||
| PUT | `/api/settings` | Update settings |
|
|
||||||
|
|
||||||
### Conversations
|
|
||||||
|
|
||||||
| Method | Endpoint | Description |
|
|
||||||
|--------|----------|-------------|
|
|
||||||
| GET | `/api/conversations` | List conversations |
|
|
||||||
| GET | `/api/conversations/{id}` | Get conversation with messages |
|
|
||||||
| DELETE | `/api/conversations/{id}` | Delete conversation |
|
|
||||||
| DELETE | `/api/conversations` | Delete ALL conversations |
|
|
||||||
|
|
||||||
### Presets
|
|
||||||
|
|
||||||
| Method | Endpoint | Description |
|
|
||||||
|--------|----------|-------------|
|
|
||||||
| GET | `/api/presets` | List presets |
|
|
||||||
| POST | `/api/presets` | Create preset |
|
|
||||||
| PUT | `/api/presets/{id}` | Update preset |
|
|
||||||
| DELETE | `/api/presets/{id}` | Delete preset |
|
|
||||||
|
|
||||||
### System
|
|
||||||
|
|
||||||
| Method | Endpoint | Description |
|
|
||||||
|--------|----------|-------------|
|
|
||||||
| GET | `/api/stats` | CPU, RAM, GPU, VRAM stats |
|
|
||||||
| GET | `/api/search/status` | SearXNG availability |
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Settings are stored in the `settings` table and include:
|
|
||||||
|
|
||||||
- `profile_enabled` — Inject profile into chats (true/false)
|
|
||||||
- `search_enabled` — Auto web search (true/false)
|
|
||||||
- `memory_enabled` — Memory injection (true/false)
|
|
||||||
- `default_model` — Default Ollama model
|
|
||||||
- `searxng_url` — SearXNG instance URL (default: `http://localhost:8888`)
|
|
||||||
|
|
||||||
## Testing Memory
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Add a memory via API
|
|
||||||
curl -X POST http://jarvis:8080/api/memories \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"fact": "User prefers native installs over Docker", "topic": "preference"}'
|
|
||||||
|
|
||||||
# Search memories
|
|
||||||
curl "http://jarvis:8080/api/memories/search?q=docker"
|
|
||||||
|
|
||||||
# List all memories
|
|
||||||
curl http://jarvis:8080/api/memories
|
|
||||||
|
|
||||||
# Get stats
|
|
||||||
curl http://jarvis:8080/api/memories/stats
|
|
||||||
```
|
|
||||||
|
|
||||||
Or in chat:
|
|
||||||
1. Say "remember that I hate YAML"
|
|
||||||
2. Later ask "what markup languages should I avoid?"
|
|
||||||
3. JarvisChat will inject the YAML preference into context
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Service won't start
|
|
||||||
|
|
||||||
Check logs:
|
|
||||||
```bash
|
|
||||||
journalctl -u jarvischat -n 50 --no-pager
|
|
||||||
```
|
|
||||||
|
|
||||||
Common issues:
|
|
||||||
- Missing `jinja2`: `./venv/bin/pip install jinja2`
|
|
||||||
- Missing `templates/` directory
|
|
||||||
- Wrong permissions on `/opt/jarvischat`
|
|
||||||
|
|
||||||
### Memory not working
|
|
||||||
|
|
||||||
1. Check memory is enabled (🧠 MEM ON in topbar)
|
|
||||||
2. Verify memories exist: `curl http://jarvis:8080/api/memories`
|
|
||||||
3. Check FTS5 table: `sqlite3 jarvischat.db "SELECT * FROM memories_fts;"`
|
|
||||||
|
|
||||||
### Web search not working
|
|
||||||
|
|
||||||
1. Verify SearXNG is running: `curl http://localhost:8888/search?q=test&format=json`
|
|
||||||
2. Check search status: `curl http://jarvis:8080/api/search/status`
|
|
||||||
3. Ensure JSON format is enabled in SearXNG settings
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
## Repository
|
|
||||||
|
|
||||||
Gitea: `ssh://gitea@llgit.llamachile.tube:1319/gramps/jarvisChat.git`
|
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ body { font-family: var(--font-body); background: var(--bg-primary); color: var(
|
|||||||
|
|
||||||
<aside class="sidebar" id="sidebar">
|
<aside class="sidebar" id="sidebar">
|
||||||
<div class="sidebar-header">
|
<div class="sidebar-header">
|
||||||
<img class="logo" src="/static/logo.png" alt="JarvisChat Logo" onerror="this.style.display='none'">
|
<img class="logo" src="/static/logo.jpg" alt="JarvisChat Logo" onerror="this.style.display='none'">
|
||||||
<h1>⚡ JarvisChat {{ version }}</h1>
|
<h1>⚡ JarvisChat {{ version }}</h1>
|
||||||
<div class="subtitle">🦙 local coding companion</div>
|
<div class="subtitle">🦙 local coding companion</div>
|
||||||
<div class="btn-row">
|
<div class="btn-row">
|
||||||
|
|||||||
Reference in New Issue
Block a user