LLM assistant for Python packages in REPLs and notebooks
Project description
LLM-powered assistant for every Python package you import.
Just add .sagely.ask("your question") to any module.
🧠 sagely Agent
sagely Agent automatically injects a .sagely assistant into every package you import. Ask questions about the library you're using, get help with errors, and explore code with syntax-highlighted answers — all powered by an LLM.
🎥 Demo
(Click to view full video)
https://github.com/superpandas-ai/sagely/assets/demo.gif
or
https://loom.com/share/sagely-demo-link
❓ Why sagely?
There are thousands of Python libraries, but their docs aren't always intuitive. sagely fills that gap:
- You don't need to search Stack Overflow every time you forget a method.
- You get context-aware help, including recent exceptions and object summaries.
- It's built for exploration — whether you're using a notebook, REPL, or script.
✨ Features
- 💬 Ask any module
.sagely.ask("How do I do X?") - 💡 Smart context: recent errors + object summaries
- 🧩 Auto-attaches to every import
- 💾 Caches answers to avoid repeated API calls
- 🎨 Syntax-highlighted output with
pygments - 🧠 IPython magic:
%sagely pandas how to merge?
🚀 Getting Started
1. Install
pip install sagely
2. Import It
import sagely
It hooks into all future imports.
🧪 Usage Examples
Inline Python
import matplotlib
matplotlib.sagely.ask("how to make a scatter plot?")
In Jupyter / IPython
%load_ext sagely
%sagely numpy how to generate random numbers?
Programmatic
from sagely import agent
agent.ask("requests", "how do I send a POST request?")
🔧 Requirements
- openai
- ipywidgets
- pygments
- ipython
(Installed automatically.)
🧠 Project Structure
sagely/
├── src/sagely/
│ ├── agent.py
│ ├── cache.py
│ ├── context.py
│ ├── import_hook.py
│ ├── ipython_magics.py
│ ├── widgets.py
│ └── __init__.py
├── tests/
├── pyproject.toml
├── MANIFEST.in
└── README.md
🤝 Contributing
sagely is early-stage — PRs and ideas welcome!
- Want to support other LLMs?
- Want advanced caching or error tracing?
- Want to auto-annotate cells with answers?
Open an issue or submit a PR. 💥
🧷 License
MIT © 2025 SuperPandas Ltd
Project details
Release history Release notifications | RSS feed
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 sagely-0.0.1.tar.gz.
File metadata
- Download URL: sagely-0.0.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e151b511af4801605600f336d28909b832a0233f70b2cf8cf13d80c0e4e717b
|
|
| MD5 |
1cce7609a7eac3dee6db66dd05a300b3
|
|
| BLAKE2b-256 |
4f1c6e525891396a242234f5dda59c9982bd395b5fb884a066087c6d97e358cf
|
File details
Details for the file sagely-0.0.1-py3-none-any.whl.
File metadata
- Download URL: sagely-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
707b97f62b67b5567a696562cb22008b9dccda68c66220b81996480cd8a44dac
|
|
| MD5 |
70bae034206baf3680442f8ef3c6746d
|
|
| BLAKE2b-256 |
8f7ed6bb98befd2dfdc1f90b6fb5c21b0b174514c6415f0dda692225a1f5c6e0
|