Skip to main content

Secure Personal AI Research Kit - Multi-provider LLM web interface with MCP tool integration

Project description

Spark

License: MIT + Commons Clause Python 3.12+ PyPI CI

Spark is a secure, multi-provider AI research kit with a modern web interface. It connects to AI models from Anthropic, AWS Bedrock, Google Gemini, Ollama, and X.AI, with features like MCP tool integration, intelligent context management, persistent memory, and autonomous scheduled actions.

Features

Conversations

  • Multi-Provider LLM Support — Claude, Gemini, Grok, Llama, Mistral, and more
  • Real-Time Streaming — Server-Sent Events for token-by-token responses
  • Dark/Light Theme — Cognisn design system with theme persistence
  • Context Compaction — LLM-driven summarisation when approaching context limits
  • Conversation Linking — Share context between related conversations
  • Favourites — Star conversations for quick access

Tools

  • MCP Integration — Connect external tool servers via stdio, HTTP, or SSE
  • Built-in Tools — Filesystem, documents (Word/Excel/PDF/PowerPoint), web search, archives
  • Memory Tools — Persistent semantic memory across conversations
  • Per-Conversation Control — Enable/disable tools at the server or individual level
  • Tool Approval — Permission prompts for first-use with allow once/always/deny

Memory

  • Persistent Storage — Facts, preferences, projects, instructions, relationships
  • Semantic Search — Vector embeddings for relevant recall
  • Auto-Retrieval — Relevant memories silently injected into context
  • Import/Export — JSON format for backup and sharing

Autonomous Actions

  • Scheduled Tasks — Cron or one-off schedules via APScheduler
  • AI-Assisted Creation — Describe what you want and the AI builds the action
  • Background Daemon — System tray icon (macOS/Windows) runs actions independently
  • Run History — Track execution status, results, and token usage

Security

  • Prompt Inspection — Pattern and keyword-based threat detection
  • Secret Management — API keys stored in OS keychain, never in config files
  • Settings Lock — Password-protect the settings page
  • Tool Permissions — Per-conversation, per-tool approval system

Installation

pip install cognisn-spark

Optional database drivers

pip install cognisn-spark[postgresql]   # PostgreSQL
pip install cognisn-spark[mysql]        # MySQL
pip install cognisn-spark[mssql]        # SQL Server
pip install cognisn-spark[all-databases] # All drivers

Quick Start

spark

On first launch, Spark creates a configuration file, starts the web server on a random port, and opens your browser. Follow the welcome page to configure an LLM provider and start chatting.

Configuration

Spark stores its configuration in platform-standard locations:

Platform Config Data Logs
macOS ~/Library/Application Support/spark/ ~/Library/Application Support/spark/ ~/Library/Logs/spark/
Linux ~/.config/spark/ ~/.local/share/spark/ ~/.local/state/spark/logs/
Windows %APPDATA%/spark/ %APPDATA%/spark/ %LOCALAPPDATA%/spark/logs/

API keys are stored in the OS keychain (macOS Keychain, Windows Credential Locker, Linux Secret Service) via the cognisn-konfig library.

Architecture

┌─────────────────────────────────────────────────────────┐
│                     Web Interface                       │
│           FastAPI + SSE + Bootstrap 5 (Cognisn)         │
├─────────────────────────────────────────────────────────┤
│                  Conversation Manager                   │
│    Context compaction · Memory · RAG · Tool routing     │
├──────────────┬──────────────┬───────────────────────────┤
│  LLM Providers              │  Tools                    │
│  Bedrock · Anthropic        │  MCP servers              │
│  Ollama · Gemini · X.AI     │  Built-in + Memory        │
├──────────────┴──────────────┴───────────────────────────┤
│                     cognisn-konfig                      │
│          Settings · Secrets · Logging                   │
└─────────────────────────────────────────────────────────┘

Keyboard Shortcuts

Shortcut Action
Ctrl/Cmd + K Go to Conversations
Ctrl/Cmd + N New Conversation
Ctrl/Cmd + , Open Settings
Enter Send message
Shift + Enter New line

Development

git clone https://github.com/Cognisn/spark.git
cd spark
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest

Changelog

See CHANGELOG.md.

Licence

MIT License with Commons Clause — free for personal and educational use. Commercial use requires a licence from the author. See LICENSE.

Author

Matthew Westwood-Hill / Cognisn

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cognisn_spark-0.1.0a2-py3-none-any.whl (203.1 kB view details)

Uploaded Python 3

File details

Details for the file cognisn_spark-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: cognisn_spark-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 203.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cognisn_spark-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c635de8f2c6f6e59cc14feb0eb146e8856fcba9276681f28a8c81fc17ea8ea5
MD5 f52c6c2727e2442d7d07d93a45046ed3
BLAKE2b-256 6b9e4326fce672f022d7e9b3f26e0ba4435f3c426689799ea97bdd0f0256f76e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognisn_spark-0.1.0a2-py3-none-any.whl:

Publisher: release.yml on Cognisn/spark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page