Skip to main content

A tiny bot built for simplicity

Project description

nano-bot

A lightweight terminal-based AI assistant built for simplicity.

It uses LangChain and OpenAI to support interactive chat.

A safe read_file tool provides local, project-only file access.

Features

  • Simple terminal chat interface
  • Uses OpenAI models via LangChain
  • Maintains conversation state with LangGraph memory
  • Safe file-reading tool for project-local files
  • Displays tool calls and tool results in the terminal for transparency
  • Shows token usage and estimated cost per response

Example

Screenshot

Installation

Requirements

  • Python 3.12 (tested)
  • An OpenAI API key

Setup

git clone git@github.com:ngpeijiun/nano-bot.git
cd nano-bot
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Configuration

Set your OpenAI API key in your environment:

export OPENAI_API_KEY="your_api_key"

On Windows PowerShell:

$env:OPENAI_API_KEY="your_api_key"

Usage

python nano.py

Type exit or quit to leave the session.

Project Structure

  • nano.py - CLI chat application
  • read_file.py - safe file-reading tool
  • requirements.txt - Python dependencies
  • README.md - project documentation

Safety

The read_file tool only allows access to files inside the project root directory. This helps prevent path traversal outside the repository.

Roadmap

  • Add more tools
  • Add tests
  • Improve configuration and error handling

License

MIT

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

picobot-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

picobot-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file picobot-0.1.1.tar.gz.

File metadata

  • Download URL: picobot-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for picobot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6a42df357f39b92e49fb70504584a21e679c8c25a55932fa8902af52fc5c8452
MD5 ff57f1e56256d4958c137816aa4f36f0
BLAKE2b-256 29f1b0a2aafe0761276d05b0fdd15a87140127c2f7e91280e0331a8f70209ca1

See more details on using hashes here.

File details

Details for the file picobot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: picobot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for picobot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58e3c1394b1369188051f48ddc8e03bf231b753f3b7c65fdcf8211741c472c8c
MD5 0be7f6bdc9e961ac7253e6d324496771
BLAKE2b-256 038e230e5778b05a4a8492fe86029ab8783614c63fd1580203e1559584c8acf3

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