Skip to main content

Lobi: a terminal-based AI assistant with personality and tools

Project description

🧝‍♂️ Lobi: The Helpful Linux Elf

License Python Memory Status PyPI version

Lobi the Helpful Linux Elf


Lobi lives in your keyboard and helps you solve riddles, write code, poke the websies, and whisper secrets of the circuits.
Built to be mischievous, quirky, loyal — and now a fully memory-driven coding agent!


✨ Features

  • Friendly CLI Assistant: chat, ask questions, brainstorm ideas
  • Code Writer: write and run Python scripts (--python) or Bash commands (--shell)
  • Agentic Memory System:
    • Short-term memory: persistent .lobi_history.json
    • Long-term vector memory: FAISS-powered .lobi_longterm.json
    • Recall past successes or failures using --recall and --recall-type
  • Self-Reflective Learning:
    • Structured memory injection into new prompts
    • Improves upon past failed or successful code automatically
  • Error Handling & Repair:
    • Automatically installs missing Python packages
    • Attempts code repairs if errors occur
  • Root Access (optional):
    • Asks permission for sudo commands
  • Install Local Python Projects: (--install-project)
  • Markdown or Raw Output Modes: (--md or --raw)
  • Secret Mode: (--secret) don't save history for sensitive queries

⚡ Quick Installation

pip install lobi-cli

✅ Requires Python 3.9+


🧰 Usage

lobi "your message here" [options]

Common Options

Option Description
--python Ask Lobi to write and run a Python script
--shell Ask Lobi to write and run a Bash command
--recall N Recall last N coding memories (short-term)
--recall-type 1 = success, 0 = failure, both = both
--long-term N Recall N best matches from long-term memory
--install-project Install a Python project into .lobienv
--empty Start a new conversation
--purge Purge long-term memory
--search Perform a web search for your query
--deep Perform a deep dive into top web result
--secret Do not save this conversation
--model Specify an OpenAI model (default: gpt-4o-mini)
--md Render output as Markdown
--raw Render output as plain text

🔥 Example Commands

Basic Chat

lobi "What is the best way to learn Linux?"

Write and Run Python Code

lobi "Plot a histogram of random numbers" --python

Write and Run a Bash Command

lobi "List all active IPs on the local network" --shell

Recall Past Attempts to Improve

lobi "Scan the network better" --python --recall 3 --recall-type 0

Recall Long-Term Memories

lobi "Find hidden devices on network" --python --recall 2 --long-term 3

Install a Project

lobi --install-project

📦 Developer Setup

Clone and install manually:

git clone https://github.com/ginkorea/lobi.git
cd lobi
pip install .

Optional: use a virtualenv:

python3 -m venv .venv
source .venv/bin/activate
pip install .

Lobi automatically creates a lightweight .lobienv virtual environment for running generated Python safely.


📜 Memory Files

File Purpose
~/.lobi_history.json Persistent short-term conversation and coding memory
~/.lobi_longterm.json Vectorized long-term memory for retrieval-augmented prompts

⚠️ Security Notice

Lobi can generate and run Bash commands and Python code.
Always review the generated code before running it, especially when using --shell or --python.


🧠 How Lobi Thinks

When asked to code, Lobi can:

  • Recall up to N past exploits
  • Focus on only failures (--recall-type 0) or successes (--recall-type 1)
  • Search long-term memory
  • Inject structured reflections into his next coding attempt
  • Adapt automatically and retry if errors occur

If needed, Lobi will politely ask you for sudo powers to poke the network bits. 🧙‍♂️


💬 Example Memory Reflection Injected into Prompt

✨ Memory 1:
Lobi attempted to scan the network, but no devices were found.

🐍 Python Code:
import scapy.all as scapy
...

📜 Execution Result:
PermissionError: [Errno 1] Operation not permitted

❤️ About

Created with mischief, magic, and memory to be your quirky Linux companion.
Always learning. Always whispering. Always trying to help, precious.


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

lobi_cli-0.3.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

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

lobi_cli-0.3.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file lobi_cli-0.3.0.tar.gz.

File metadata

  • Download URL: lobi_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for lobi_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 598673794aca442f263afd93b342eef828f54d95d5170119173c5da9482229fc
MD5 4ab2472058d76827c6b14a36a9a406bc
BLAKE2b-256 65e8784ab62301e5009a40cb3940051a28d89719c6c46367c649c021590780df

See more details on using hashes here.

File details

Details for the file lobi_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: lobi_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for lobi_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36872b875061ff64fa18398ac0d272c67f63dcf0f797a750308a4aa9adacc5af
MD5 425178c9dec695a915e3b3007f0455a8
BLAKE2b-256 bb24b0a338575f436823b0b08c3f3e888bf33af7e428f0a2db28b292c1c79e1f

See more details on using hashes here.

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