Skip to content

Getting Started

Prerequisites

Install Miniconda

Install Miniconda with the official installer:

bash
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda_installer.sh
bash /tmp/miniconda_installer.sh -b -p ~/miniconda3
~/miniconda3/bin/conda init bash

Reload your shell:

bash
source ~/.bashrc

Check the installation:

bash
conda --version

Install Project Dependencies

The project uses Python 3.11, managed through environment.yml.

Create the conda environment and install all dependencies:

bash
conda env create -f environment.yml

Activate the environment:

bash
conda activate knowledge

Environment Variables

Shared (API + ingestion job)

VariableRequiredDefaultDescription
QDRANT_URLyes-URL of the Qdrant instance (http://localhost:6333)
QDRANT_COLLECTION_CODEyes-Collection for source-code chunks (ingestion)
QDRANT_COLLECTION_METADATAyes-Collection for metadata chunks (ingestion)
EMBEDDING_MODELyes-HuggingFace model identifier - see tip below
EMBEDDING_BATCH_SIZEno8Chunks embedded per batch during ingestion
LOG_LEVELnoINFOLog verbosity (DEBUG, INFO, WARNING, …)

API service

VariableRequiredDefaultDescription
LLM_API_KEYyes-API key for the LLM provider
LLM_MODELyes-Chat model identifier (e.g. gpt-4o-mini)
LLM_ENDPOINTyes-Base URL of any OpenAI-compatible API
APP_SECRETyes*-Secret to sign and verify JWT tokens (* required when auth is on)
KNOWLEDGE_AUTH_ENABLEDnotrueSet to false to disable JWT auth
JWT_AUDIENCEnokalisioExpected aud claim for incoming tokens
JWT_ISSUERnokalisioExpected iss claim for incoming tokens
JWT_ALGORITHMnoHS256Algorithm used to verify JWT signatures
TOP_Kno6Number of chunks returned per retrieval
MAX_CONTEXT_CHARSno14000Max characters of context fed to the LLM
MAX_ANSWER_TOKENSno1024Max tokens the LLM may generate per answer
HOSTno127.0.0.1Host the API binds to
PORTno8187Port the API listens on

Ingestion job

VariableRequiredDefaultDescription
KLI_ORGANIZATIONnokalisioGitHub organisation passed to k-clone
KLI_WORKSPACEnoappskli workspace to index
GIT_HISTORY_LIMITno10Recent commits attached to each chunk

Choosing an embedding model

EMBEDDING_MODEL accepts any SentenceTransformers model identifier from HuggingFace(Qwen/Qwen3-Embedding-0.6B, Qwen/Qwen3-Embedding-4B, nomic-ai/nomic-embed-text-v1.5)

OpenAI models for the LLM

LLM_ENDPOINT follows the OpenAI API format, so any OpenAI-compatible provider works without code changes: OpenAI (gpt-4o, gpt-4o-mini, gpt-4.1), Mistral, Ollama (local), and others.

Run the Project

Start the API:

bash
python -m api.main

Run the ingestion job:

bash
python -m ingestion