ELISA (Emacs Lisp Information System Assistant) is a project designed to help Emacs users quickly find answers to their questions related to Emacs and Emacs Lisp. Utilizing the powerful Ellama package, ELISA provides accurate and relevant responses to user queries, enhancing productivity and efficiency in the Emacs environment. By integrating links to the Emacs info manual after answering a question, ELISA ensures that users have easy access to additional information on the topic, making it an essential tool for both beginners and advanced Emacs users.
ELISA creates index from info manuals. When you send message to
elisa-chat
it search to semantically similar info nodes in index,
get first elisa-limit
nodes, add it to context and send your message
to llm. LLM generates answer to your message based on provided
context. You can read not only answer generated by llm, but also info
manuals by provided links.
You need emacs 29.2 or newer to use this package. Will be on package
archives soon. For now you can use package-vc
to install ELISA:
(package-vc-install "https://github.com/s-kostyaev/elisa")
Then you need to download sqlite-vss
. You can do it manually from
https://github.com/asg017/sqlite-vss/releases or by calling M-x
elisa-download-sqlite-vss
.
You can use this package with different llm providers. By default it uses ollama provider both for embeddings and chat. If you ok with it, you need to install ollama and pull used models:
ollama pull nomic-embed-text
ollama pull sskostyaev/openchat:8k-rag
Second model is just openchat with exactly 2 tweaks: context window extended to 8k and temperature set to 0 to better usage for RAG (Retrieval Augmented Generation). You can try other models, for example:
- all-minilm for embeddings
- sskostyaev/mistral:32k-rag for chat
- other models or providers
- create your own model
Create index for builtin, external or all info manuals by one of this commands:
elisa-async-parse-builtin-manuals
elisa-async-parse-external-manuals
elisa-async-parse-all-manuals
This can take some time.
Entrypoint. Makes similarity search in index, add semantically similar
info nodes into context and query llm for prompt. Uses ellama
under
the hood. Call one of parse manuals functions to create index before
use it.
Download sqlite vss extension to provide similarity search.
Parse builtin emacs info manuals asyncronously. Can take long time.
Parse external emacs info manuals asyncronously.
Parse all emacs info manuals asyncronously.
One of parse functions should be called before elisa-chat
to create
index.
Example configuration. With default installation you don’t need it.
(use-package elisa
:init
(setopt elisa-limit 5)
(require 'llm-ollama)
(setopt elisa-embeddings-provider (make-llm-ollama :embedding-model "nomic-embed-text"))
(setopt elisa-chat-provider (make-llm-ollama
:chat-model "sskostyaev/openchat:8k-rag"
:embedding-model "nomic-embed-text")))
The following variables can be customized for ELISA:
elisa-embeddings-provider
: Embeddings provider to generate embeddings.elisa-chat-provider
: Chat provider.elisa-db-directory
: Directory for elisa database.elisa-limit
: Count info nodes to pass into llm context for answer.elisa-find-executable
: Path to find executable.elisa-tar-executable
: Path to tar executable.elisa-sqlite-vss-version
: Sqlite VSS version.
To contribute, submit a pull request or report a bug. This library is planned to be part of GNU ELPA; major contributions must be from someone with FSF papers. Alternatively, you can write a module and share it on a different archive like MELPA.