Installing and Deploying InsightStream
This page contains step-by-step instructions for installing and deploying InsightStream on a server using Docker Compose. It describes the system architecture, key components, and main stages of environment setup, startup, and system health checks.
System Architecture
Main InsightStream Components
- Database: Qdrant, used for storing and searching data.
- Message Bus: RabbitMQ, manages task queues and message exchange between services.
- Indexer: works with Qdrant for storing and searching data, allowing to find relevant documents.
- Summarizer: uses LLM to create brief and accurate answers to queries.
- Search Web Interface: provides access to the system through a browser, built on React.js and interacts with backend via REST API.
InsightStream does not have built-in authentication. Additional configuration of RabbitMQ and Qdrant is done separately and described in their documentation.
InsightStream Configuration
InsightStream configuration is set via environment variables (variables and their values are set in the .env file).
Main InsightStream Server Access Parameters
The values of these configuration variables must be set according to how server access will be implemented.
# Server for uploading documents and API access
BASE_URL=http://server_address_or_domain_name:8080
AVAILABLE_USERS="['API_access_key']"
The address specified in the BASE_URL variable will be used both for accessing the system web interface and for interaction between components. Consider this when configuring firewall rules and in cases where split-horizon DNS is used in the network.
Using addresses 127.0.0.1 or localhost in this variable will cause incorrect system operation.
Additional .env Settings
For correct operation of InsightStream, you need to specify the full set of variables for other components (the components themselves will be installed automatically in the following steps).
# Keys and URLs for LLM API
CHAT_API_KEY="empty"
CHAT_MODEL="Compressa-LLM"
CHAT_API_BASE=http://compressa-nginx/v1/
# Embedding settings
EMBED_MODEL="Compressa-Embedding"
EMBED_TIKTOKEN_MODEL="Salesforce/SFR-Embedding-Mistral"
EMBED_API_KEY="empty"
EMBED_API_BASE=http://compressa-nginx/v1/
# Rerank settings
RERANK_MODEL="Compressa-ReRank"
RERANK_API_KEY="empty"
RERANK_API_BASE=http://compressa-nginx/v1/
NUM_DOCS="7"
Database and Message Queue
If Qdrant and RabbitMQ are already deployed in your infrastructure, you can specify access data for them in these variables:
# Qdrant database and RabbitMQ queue
QDRANT_URL=http://qdrant:6333
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/
When using external RabbitMQ, it's recommended to create a separate vhost for InsightStream operation.
When using RabbitMQ supplied as an InsightStream component, you can change the default user data. To do this, you need to set values for environment variables RABBIT_USER and RABBIT_PASS, and also change the RABBITMQ_URL variable value in the .env file accordingly.
Installation Steps
Environment Check
- Make sure Docker and Docker Compose are installed.
- Check access to Docker Registry for downloading images or that images are imported using
docker load.
Component Configuration
- Familiarize yourself with documentation for Qdrant and RabbitMQ.
- Specify component locations in the compose file environment variables.
Preparing Docker Compose File
- Configure the InsightStream components configuration file.
- Use the
.envfile to simplify environment variable configuration (you can use the.env.examplefile as a base and edit it)
System Startup
Execute the command to start containers in the background:
docker-compose up -d
Health Check
- Check running containers:
docker ps
- If errors occur, view container logs:
docker logs <container_name>
Component Access
After successful system startup, you can access main components at the following addresses:
- Indexing Web Interface (WebUI): http://server_address_or_domain_name:8080/indexui/
- Indexing API: http://server_address_or_domain_name:8080/indexapi/
- Search Interface: http://server_address_or_domain_name:8080/INDEX_ID_where_search_is_performed
Security
By default, InsightStream does not have built-in authentication, so it's recommended to use a reverse proxy (e.g., Nginx) to protect API access. Below is an example Nginx configuration using a fixed token:
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;
location /api/ {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ($http_authorization != "Bearer your_API_key") {
return 401;
}
}
}
It's recommended to consider integration with corporate SSO system or using OAuth2 to increase security level.
Conclusion
After completing all described steps, InsightStream will be ready for operation. You'll be able to upload documents, create assistants, and search the knowledge base. For further work, familiarize yourself with the following documentation sections.