Overview
This guide will help you start SIAA, convert your first documents, and make your first intelligent query to the system.Make sure you’ve completed the installation guide before proceeding.
Starting SIAA
Start Ollama Service
Start the Ollama service that powers the AI model:Verify the model is loaded:You should see
This command runs in the foreground. Open a new terminal for the next steps, or run it in the background with
nohup ollama serve > /tmp/ollama.log 2>&1 &qwen2.5:3b in the response.Start the Flask Proxy Server
Navigate to your SIAA directory and start the proxy server:The server will start on port 5000 and you’ll see output like:
Converting Documents
Prepare Your Documents
Place your documents in the appropriate directories:For institutional documents (Word/Excel pairs):For PDF documents:
Each subfolder in
/opt/siaa/instructivos should contain one Word document (.doc or .docx) and one Excel file (.xls or .xlsx).Convert Institutional Documents
Run the main converter for Word/Excel documents:You’ll see output showing the conversion progress:
The converter automatically reloads the SIAA document index after successful conversion.
Convert PDF Documents
For PDF documents, use the specialized PDF converter:The converter automatically detects if a PDF has native text or requires OCR:
If pymupdf extracts less than 200 characters, the system automatically falls back to OCR using Tesseract.
Using the Web Interface
Open the Web Interface
Open your browser and navigate to:Or if accessing from another machine:
The web interface is located at
Web/index.html and is served automatically by the Flask proxy.Make Your First Query
Try asking a question about your documents:Example queries:
- “¿Qué es el SIERJU?”
- “¿Cuándo debo reportar la información?”
- “¿Quién es responsable de cargar los datos?”
- “¿Qué sanciones hay por incumplimiento?”
- Classify your question (conversational or document-based)
- Find relevant documents using the TF-IDF index
- Extract relevant chunks with overlap
- Generate a response using the Qwen2.5:3b model
- Provide source citations
Making API Queries
You can also query SIAA via the REST API:The API streams responses using Server-Sent Events (SSE) for real-time output. Each chunk is prefixed with
data: .Monitoring System Health
Check System Status
documentos_cargados: Number of indexed documentscache.hit_rate: Percentage of queries served from cacheollama_disponible: Ollama service availability
View Quality Logs
SIAA logs all queries to/opt/siaa/logs/calidad.jsonl:
The log file is in JSONL format (one JSON object per line) for easy analysis with
jq, grep, or Python.Access Logs via API
Performance Tips
Cache Efficiency
The LRU cache stores up to 200 queries for 1 hour. Repeated queries return in ~5ms vs 44s.Monitor cache hit rate:
curl http://localhost:5000/siaa/status | jq .cache.hit_rateDocument Chunking
Documents are split into 800-character chunks with 300-character overlap, ensuring context preservation.Configured in
siaa_proxy.py:294-296Concurrent Queries
The system supports up to 2 concurrent Ollama queries with 16 server threads.Configured in
siaa_proxy.py:277-278Model Warm-up
The Qwen2.5:3b model is preloaded into RAM on startup for faster first query.See warm-up logic in
siaa_proxy.py:509-529Advanced Configuration
Convert Specific Folders Only
Force OCR for All PDFs
Reconvert Only Empty/Failed Documents
Custom Paths
Troubleshooting
No documents loaded
No documents loaded
Check if documents were converted correctly:Reload the index:
Slow query responses
Slow query responses
Check Ollama status:Verify the model is loaded:Monitor system resources:Qwen2.5:3b requires approximately 2-4GB RAM.
Document conversion fails
Document conversion fails
Check conversion logs:Common issues:
- LibreOffice not installed:
which libreoffice - Permission errors:
sudo chown -R $USER /opt/siaa - Corrupted documents: Try manual conversion
Cache not working
Cache not working
Verify cache configuration in Check cache stats:
siaa_proxy.py:61-63:Next Steps
API Reference
Explore all available API endpoints
Document Management
Learn about document organization and indexing
System Architecture
Understand how SIAA works internally
Administration
Configure and monitor your SIAA instance