Skip to main content

>_⚡ Instrukt

Terminal AI Commander at your fingertips

coding assistant example

Checkout demos for more examples.

NOTE: This is a work in progress, expect bugs and api changes.

Introduction

Instrukt is a terminal-based AI integrated environment. It offers a platform where users can:

  • :robot: Create and instruct modular AI agents
  • :card_file_box: Generate document indexes for question-answering
  • :toolbox: Create and attach tools to any agent

Agents are simple drop-in Python packages that can be extended, shared with others, attached to tools and augmented with document indexes.

Instruct them in natural language and, for safety, run them inside secure containers (currently implemented with Docker) to perform tasks in their dedicated, sandboxed space :shield:.

Built with: Langchain, Textual, Chroma

Consulting Services: Need help with Langchain or AI integration ? You can reach out to me at contact@blob42.xyz

TOC

Usage

Quickstart

  • pip install instrukt[all]

  • export OPENAI_API_KEY with your OpenAI API key.

  • run instrukt

  • If the color scheme is broken, export TERM=xterm-256color

  • A configuration file will be created at: ~/.config/instrukt/instrukt.yml

You can run instrukt on headless server such or a docker container with CUDA support.

NOTE: if you are starting with a bare container, you need at least g++ and libmagic.

Check the quickstart and install guide for more details.

From source:

  • Make sure the latest version of poetry is installed.
  • Set your virtualenv
  • Clone the repository
  • Run poetry install -E all --with dev,test
  • This will install Instrukt including extra tools for agents.

See the installation guide for more details

Default Agents:

Coding AI: A coding assistant. Create indexes over any code base and attach it to the agent to do RAG (Retrieval Augmented Generation)

Chat Q&A: A simple conversational agent.

Features

:computer: Keyboard and Mouse Terminal Interface:

  • A terminal-based interface for power keyboard users to instruct AI agents without ever leaving the keyboard.
  • Rich colorful agent outputs with markdown and source code support thanks to the Textual TUI library.
  • Run Instrukt on bare metal or docker containers with CUDA support.
  • Remote access with SSH and terminal multiplexers.

:robot: Custom AI Agents:

  • Design custom agents and tools.
  • Agents are simple python packages can be shared and loaded by other users.

:books: Chat with code and documents:

  • Index your data and let agents retrieve it for question-answering.
  • Create and organize your indexes with an easy UI.
  • Index creation will auto detect programming languages and optimize the splitting/chunking strategy accordingly.
  • Fuzzy select (fzf, dmenu ...) source documents that were used for retrieval ctrl+p

:wrench: Tools:

  • Use the pre-defined toolset or design your own tools.
  • Attach or detach tools to agents on-the-go, tailoring your AI workflows to your needs.

:zap: Prompt Console :

  • Integrated REPL-Prompt for quick interaction with agents, and a fast feedback loop for development and testing.
  • Automate repetitive tasks with custom commands.
  • Builtin prompt/chat history.
  • Use vim, emacs or any external $EDITOR to edit messages.

:bird: LangChain:

  • Leverage the LangChain ecosystem to automate anything.
  • WIP: Extensible API for integrating with other frameworks.

:shield: Secure Containers:

  • Run agents inside secure docker containers for safety and privacy.
  • Use gVisor runtime for a full isolation of the agent.

note: The docker agent is only available to Patreon supporters as an early preview.

:microscope: Developer Console:

Debug and introspect agents using an in-built IPython console. ctrl+d

ipython debug shell

Document Indexes and Question-Answering

  • Indexes can be created using OpenAI or local embeddings models.
  • Chroma for managing indexes.
  • Create and manage indexes using the Index Management UI (press I)
  • Indexing a directory will auto detect programming languages and use an appropriate splitting strategy optimized for the target language.
  • Indexes can be attached to any agent as a retrieval tool using the index menu in the top of the agent's window.
  • Agents can use attached indexes for question-answering.

Supported platforms:

  • Linux/Mac.
  • Windows tested under WSL2.

LLM Models

  • Currently only OpenAI supported.
  • Using private local models is the next milestone.

Roadmap

  • private local LLM models

  • Indexing and embeddings

    • Index directories and auto detect content. ( see AutoDirLoader)
    • Detect programming languages and use the appropriate splitter.
    • Load a git repository from URL
    • Load any webpage / website.
  • Documentation

    • Creating agents
    • Creating tools
    • Indexing and chat with documents and source code.
    • Example use cases
    • Tutorials.

Contributing

Any contribution, feedback and PR is welcome !

You can help with:

  • Testing and creating Issues for bugs or features that would be useful.
  • If you have technical skills, you are welcome to create a PR.
  • If you don't have technical skills you can help with documentation, adding examples and tutorials or create new user stories.

Patreon

By becoming a patron, you will help me continue committing time to the development of Instrukt and bring to life all the planned features. Check out the Patreon page for more details on the rewards for early supporters.

Social

Join the Discord server to keep updated on the progress or ask for help.

Vision

AI should be accessible to everyone and not a walled garden for big corporations and SaaS services.

Instrukt is a modest contribution to create tools that empower users without compromising their freedoms. The short-term goal is to make it usable with minimal reliance on external APIs and services, giving users the choice to opt for local models and self-hosted services.

License

Copyright (c) 2023 Chakib Ben Ziane. All Rights Reserved.

Instrukt is licensed with a AGPL license, in short this means that it can be used by anyone for any purpose. However, if you decide to make a publicly available instance your users are entitled to a copy of the source code including all modifications that you have made (which needs to be available trough an interface such as a button on your website), you may also not distribute this project in a form that does not contain the source code (Such as compiling / encrypting the code and distributing this version without also distributing the source code that includes the changes that you made. You are allowed to distribute this in a closed form if you also provide a separate archive with the source code.).

Metadata

Release files for instrukt 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instrukt 0.6.3
File Size Uploaded
instrukt-0.6.3.tar.gz 517.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for instrukt 0.6.3
File Interpreter ABI Platform
instrukt-0.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / instrukt-0.6.3.tar.gz

Download URL instrukt-0.6.3.tar.gz
Size 517.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7eaba3362c269bbe105b89d17eba3b86975c27b7066c55540e64aa126768f046
BLAKE2b-256 checksum
How to use checksums
76fc52e34bfcaf508e44ac06705b4875038d1e46ffa309af89287fec49e9e473
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.3 Linux/6.3.2-zen1-1-zen

Release files / instrukt-0.6.3-py3-none-any.whl

Download URL instrukt-0.6.3-py3-none-any.whl
Size 584.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ac36ac87d85be33736115e9aa452fa2f47687faf5fd68d819403bb0012558a0
BLAKE2b-256 checksum
How to use checksums
a0967ccf93fed3edcede072d07ca06c43cd823bbb0d91d3e0d706d2acb4bd9ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.3 Linux/6.3.2-zen1-1-zen

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files

0.6.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page