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
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 applicationread_file.py- safe file-reading toolrequirements.txt- Python dependenciesREADME.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a42df357f39b92e49fb70504584a21e679c8c25a55932fa8902af52fc5c8452
|
|
| MD5 |
ff57f1e56256d4958c137816aa4f36f0
|
|
| BLAKE2b-256 |
29f1b0a2aafe0761276d05b0fdd15a87140127c2f7e91280e0331a8f70209ca1
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58e3c1394b1369188051f48ddc8e03bf231b753f3b7c65fdcf8211741c472c8c
|
|
| MD5 |
0be7f6bdc9e961ac7253e6d324496771
|
|
| BLAKE2b-256 |
038e230e5778b05a4a8492fe86029ab8783614c63fd1580203e1559584c8acf3
|