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

App 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.0.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.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: picobot-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 89055de318926280d97293989a1c3aa4f050e1987c4cc5ca782196b4832220d7
MD5 ed5f57ee0b407756229c8e0c7788dc0c
BLAKE2b-256 0e0d64dc8eb15816526fe05ac3fc3570d931f65b3f8191f5c95fc905950a4623

See more details on using hashes here.

File details

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

File metadata

  • Download URL: picobot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebe820c48a7cc59786a853c60bcb65d05fe8741b416fe03ead8b7aa5422f14d7
MD5 4e1fbbfd778fea464e5259c62d7dea38
BLAKE2b-256 c7e0d2b15ca8ffe02f72511782fd6e032a4a65c6df8bac728c1f9fe6d200060b

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