Skip to main content

Your AI copilot in the terminal - a LangGraph-powered CLI chatbot with long-term memory

Project description

Saarthi CLI

Saarthi (सारथी) means guide or companion in Hindi.

Your AI copilot in the terminal.

Saarthi is a LangGraph-powered CLI chatbot with persistent memory, real-time token streaming, MCP integration, and multi-provider LLM support. It runs entirely inside the terminal with a custom TUI built using prompt-toolkit.

No browser. No Electron. No cloud dashboard.

PyPI version Python Versions License GitHub release


Demo

Saarthi CLI demo


Features

  • Short-term and long-term memory support
  • Local SQLite-backed conversation persistence
  • Named chat sessions with resume support
  • Real-time token streaming
  • Live tool-call visualisation
  • MCP (Model Context Protocol) server support
  • Interactive terminal UI built with prompt-toolkit
  • Multi-provider LLM support
  • Local-first architecture — no data leaves your machine
  • Built-in developer tools

Supported providers

  • OpenAI
  • Google Gemini
  • Mistral AI

More providers (including Anthropic and local model support) are planned.


Built-in tools

Tool Description
bash Execute shell commands and Python snippets
calculator Evaluate mathematical expressions
ddg_tool DuckDuckGo web search
wiki_tool Wikipedia lookup
arxiv_tool arXiv paper search

Installation

Using pip

pip install saarthi-cli
saarthi

Using uv

uv tool install saarthi-cli
saarthi

From source

git clone https://github.com/snehangshu2002/saarthi-cli.git
cd saarthi-cli
uv sync
uv run python main.py

Linux / macOS install script

curl -fsSL https://raw.githubusercontent.com/snehangshu2002/saarthi-cli/main/install.sh | bash

Note: The install script is for Linux and macOS only. Windows users should install via pip install saarthi-cli or uv tool install saarthi-cli.


First-time setup

On first launch, Saarthi walks you through a one-time setup:

  1. Choose a username
  2. Select an LLM provider
  3. Enter your API key (input is hidden)

Local storage

All configuration and memory are stored locally — nothing is sent to any external service beyond your chosen LLM provider.

Platform Storage Path
Windows %LOCALAPPDATA%\saarthi\
Linux / macOS ~/.local/share/saarthi/

Contents:

  • settings.json — provider and user config
  • mcp_config.json — MCP server definitions
  • SQLite database — conversation memory

Commands

Command Description
/help Show available commands
/new Start a new session
/resume Resume an older session
/settings View current configuration
/mcp Show connected MCP servers
/exit Quit Saarthi

MCP support

Saarthi supports MCP-compatible servers over STDIO transport. Edit mcp_config.json in your local storage directory to add servers.

Default configuration:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/dir"
      ],
      "transport": "stdio"
    }
  }
}

You can connect MCP servers for filesystem access, browser automation, databases, coding agents, external APIs, and custom tools.


Memory system

Saarthi supports two memory layers:

  • Short-term memory — active conversation context
  • Long-term memory — persisted locally in SQLite across sessions

Conversation history can also be summarised automatically to reduce context size while preserving important information.


Roadmap

  • Human-in-the-loop workflows
  • Planning mode
  • Autonomous execution mode
  • Skill system support
  • Export conversations
  • Anthropic and local model support
  • Plugin-style custom tools
  • Better configuration management
  • More CLI-agent style workflows

Project structure

src/chatbot_cli/
├── app.py
├── chatbot.py
├── ui.py
├── streaming.py
├── tool.py
├── memory.py
├── sessions.py
├── providers.py
├── mcp_client.py
├── settings.py
└── clipboard.py

License

MIT — see LICENSE for details.

Project details


Download files

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

Source Distribution

saarthi_cli-0.1.2.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

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

saarthi_cli-0.1.2-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file saarthi_cli-0.1.2.tar.gz.

File metadata

  • Download URL: saarthi_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for saarthi_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 89bee51ed366226e9ecc75cff2d8a753ce0b35ebb4a790432498947297e8213b
MD5 49373e583a6b4de28cd94d932e0238ad
BLAKE2b-256 e1f7f01c704caf773e3797cbf7413c8fc85c4495a3cd0c19ca01cda20c9152b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for saarthi_cli-0.1.2.tar.gz:

Publisher: publish.yml on snehangshu2002/saarthi-cli

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

File details

Details for the file saarthi_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: saarthi_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for saarthi_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 70d05d70951e0473f621a09eda950aa386fad0247e7f4885c6e7ef654d692660
MD5 2717b54574b46efca3b72e255033aea2
BLAKE2b-256 9da16eef72034083712e2bedec7d68366d5ddb4d0b783d01942710b8c4a72086

See more details on using hashes here.

Provenance

The following attestation bundles were made for saarthi_cli-0.1.2-py3-none-any.whl:

Publisher: publish.yml on snehangshu2002/saarthi-cli

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