Instrukt is an integrated terminal-based AI environment designed to let users build, test, and direct modular AI agents. It provides the following core capabilities:
- Create and direct modular AI agents.
- Generate document indexes for question answering.
- Create tools and attach them to any agent.
Agents are simple Python packages that can be extended, shared with others, attached to tools, and enhanced through document indexes. Users can direct agents in natural language, and for safety, agents can run in secure containers (currently implemented through Docker), executing tasks within a dedicated sandboxed space.
The project is built on Langchain, Textual, and Chroma.
Key features include:
- A terminal interface suited to keyboard operation, allowing you to direct AI agents without leaving the keyboard.
- Rich colored agent output, supporting Markdown and source code, thanks to the Textual TUI library.
- Can run on bare metal or in CUDA-enabled Docker containers.
- Remote access via SSH and terminal multiplexers.
- Design custom agents and tools.
- Agents are simple Python packages that can be shared and loaded by other users.
- Index data and let agents retrieve it for question answering.
- Create and manage indexes through a simple UI.
- Index creation automatically detects the programming language and optimizes the splitting/chunking strategy accordingly.
- Fuzzy selection (fzf, dmenu, etc.) for retrieved source documents (ctrl+p).
- Use a predefined toolset or design your own tools.
- Attach or detach tools to agents at any time to customize AI workflows.
- Integrated REPL-Prompt for quick interaction with agents, as well as a fast feedback loop for development and testing.
- Use custom commands to automate repetitive tasks.
- Built-in prompt/chat history.
- Edit messages using vim, emacs, or any external $EDITOR.
- Leverage the LangChain ecosystem to automate any task.
- In development: an extensible API for integration with other frameworks.
- Run agents in secure Docker containers, ensuring safety and privacy.
- Use the gVisor runtime to achieve complete isolation of agents.
- Debug and inspect agents using the built-in IPython console (ctrl+d).
- Indexes can be created using OpenAI or local embedding models.
- Use Chroma management index.
- Create and manage indexes through the index management UI (press I).
- The index directory automatically detects the programming language and uses a segmentation strategy optimized for the target language.
- Indexes can be attached to any agent as a retrieval tool through the index menu at the top of the agent window.
- Agents can use attached indexes for question answering.
Supported platforms:
- Windows tested under WSL2.
- Currently only OpenAI is supported.
- Using private local models is the next milestone.
Installation and usage:
- Install: pip install instrukt[all]
- Set the OPENAI_API_KEY environment variable.
- If there are issues with the color scheme, export TERM=xterm-256color.
- The configuration file will be created at: ~/.config/instrukt/instrukt.yml
- Instrukt can run on a headless server or a CUDA-enabled Docker container.
- Note: if starting from a bare container, at least g++ and libmagic are required.
- Development installation: make sure the latest version of poetry is installed, set up a virtual environment, clone the repository, and run poetry install -E all --with dev,test.
Default agents:
- Coding AI: coding assistant. Can create indexes on any codebase and attach them to the agent for RAG (Retrieval-Augmented Generation).
- Chat Q&A: simple conversational agent.
Indexes and embeddings:
- Index directories and automatically detect content (see AutoDirLoader).
- Detect programming languages and use the appropriate splitter.
- Load git repositories from a URL.
- Load any web page/website.
Documentation:
- Create agents
- Create tools
- Index and chat with documentation and source code.
- Example use cases
- Tutorials.
Note: this is a work-in-progress project, and bugs and API changes are expected.
License: AGPL license.