A production-grade, private RAG (Retrieval-Augmented Generation) system for organizations. AKIS enables natural language querying over internal knowledge sources with high accuracy, source traceability, and permission-aware access control.
- Multi-Source Ingestion: Notion, Google Drive, GitHub, PDFs, local files
- Hybrid Search: Combines semantic (vector) and keyword-based retrieval
- LLM Agnostic: Supports OpenAI, Anthropic, and self-hosted models
- Permission-Aware: Role-based access control (RBAC)
- Source Attribution: Every answer includes verifiable citations
- Uncertainty Handling: Explicit "insufficient data" responses when appropriate
- Client Infrastructure: Deploy on your cloud or on-premise servers
- No External Training: Your data stays private
- Docker & Docker Compose (recommended)
- Python 3.11+ (for local development)
- 8GB+ RAM
- LLM API access (OpenAI, Anthropic) or local model server
git clone <repository-url>
cd akis
cp .env.example .envEdit .env with your settings:
# LLM Configuration (choose one)
LLM_PROVIDER=openai
LLM_MODEL=gpt-4-turbo-preview
OPENAI_API_KEY=your_openai_key_here
# Or use Anthropic
# LLM_PROVIDER=anthropic
# LLM_MODEL=claude-3-opus-20240229
# ANTHROPIC_API_KEY=your_anthropic_key_here
# Data Source Credentials
NOTION_API_KEY=your_notion_key
GOOGLE_CREDENTIALS_PATH=./credentials/google_creds.json
GITHUB_TOKEN=your_github_token
# Security
SECRET_KEY=generate_a_secure_random_string_here
POSTGRES_PASSWORD=secure_database_passworddocker-compose up -dThis will start:
- PostgreSQL (metadata & user management)
- Redis (task queue)
- Elasticsearch (keyword search)
- ChromaDB (vector storage)
- AKIS API
- Celery workers (background processing)
docker-compose exec api python scripts/setup_db.py
docker-compose exec api python scripts/init_indices.py- API: http://localhost:8000
- API Docs: http://localhost:8000/api/docs (development only)
- Health Check: http://localhost:8000/health
curl -X POST http://localhost:8000/api/v1/query/ask \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"query": "What is our deployment process for production?"
}'Response:
{
"query": "What is our deployment process for production?",
"answer": "Based on the engineering docs, the deployment process involves...",
"citations": [
{
"source_title": "Production Deployment Guide",
"source_system": "notion",
"excerpt": "..."
}
],
"confidence": 0.85,
"has_sufficient_context": true
}curl -X POST http://localhost:8000/api/v1/admin/sources \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ADMIN_TOKEN" \
-d '{
"source_type": "notion",
"config": {
"database_id": "your_notion_database_id"
},
"sync_schedule": "0 */6 * * *"
}'┌─────────────┐
│ Client │
└──────┬──────┘
│
▼
┌─────────────────────────────────────────┐
│ FastAPI REST API │
│ ┌────────────┐ ┌────────────┐ │
│ │ Query │ │ Admin │ │
│ │ Routes │ │ Routes │ │
│ └─────┬──────┘ └─────┬──────┘ │
└────────┼─────────────────┼──────────────┘
│ │
▼ ▼
┌─────────────────────────────────────────┐
│ Core Services │
│ ┌───────────┐ ┌──────────┐ ┌───────┐ │
│ │ Retriever │ │ LLM │ │ RBAC │ │
│ │ (Hybrid) │ │ Gateway │ │ │ │
│ └─────┬─────┘ └────┬─────┘ └───────┘ │
└────────┼─────────────┼──────────────────┘
│ │
▼ ▼
┌─────────────────────────────────────────┐
│ Data Layer │
│ ┌──────────┐ ┌───────────┐ ┌───────┐ │
│ │ Vector │ │ Keyword │ │ SQL │ │
│ │ DB │ │ Search │ │ DB │ │
│ │(ChromaDB)│ │(Elastic) │ │(Pgsql)│ │
│ └──────────┘ └───────────┘ └───────┘ │
└─────────────────────────────────────────┘
▲
│
┌────────┴────────┐
│ Ingestion & │
│ Processing │
│ (Celery) │
└─────────────────┘
Switch models without code changes:
# In .env or config
LLM_PROVIDER=openai
LLM_MODEL=gpt-4-turbo-preview
# Or switch to Anthropic
LLM_PROVIDER=anthropic
LLM_MODEL=claude-3-opus-20240229
# Or use local model via Ollama
LLM_PROVIDER=local
LOCAL_LLM_URL=http://ollama:11434
LLM_MODEL=llama2Customize per document type:
# Text documents
CHUNK_SIZE=1000
CHUNK_OVERLAP=200
# Code files
CODE_CHUNK_SIZE=1500Balance semantic vs keyword search:
# 0.0 = pure keyword, 1.0 = pure semantic
HYBRID_ALPHA=0.5AKIS uses JWT tokens for authentication:
# Generate token (admin only)
POST /api/v1/admin/users/token
{
"username": "user@company.com",
"password": "secure_password"
}Three roles supported:
- Admin: Full system access
- User: Query access only
- Auditor: Read-only log access
Each deployment is fully isolated:
- Dedicated database schemas
- Separate vector collections
- Encrypted storage and transit
/health: Basic health check/ready: Readiness probe (checks dependencies)
ENABLE_METRICS=true
METRICS_PORT=9090Access Prometheus metrics at http://localhost:9090/metrics
All queries and access events are logged:
ENABLE_AUDIT_LOGGING=trueView logs:
docker-compose logs -f api# Run all tests
pytest
# With coverage
pytest --cov=src --cov-report=html
# Specific test suite
pytest tests/test_ingestion/-
Security:
- Change
SECRET_KEYto secure random value - Set strong
POSTGRES_PASSWORD - Use HTTPS/TLS for API
- Enable firewall rules
- Rotate API keys regularly
- Change
-
Performance:
- Adjust
API_WORKERSbased on CPU - Configure resource limits in docker-compose
- Set up database connection pooling
- Enable caching where appropriate
- Adjust
-
Reliability:
- Configure backup strategy
- Set up monitoring/alerting
- Test disaster recovery
- Document runbooks
-
Scaling:
- Use external managed services (RDS, ElasticSearch)
- Deploy behind load balancer
- Implement rate limiting
- Set up horizontal pod autoscaling (K8s)
Helm charts available in /deploy/kubernetes/:
helm install akis ./deploy/kubernetes/akis-chart \
--set api.replicas=3 \
--set postgresql.enabled=false \
--set postgresql.host=your-rds-endpoint# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies
pip install -r requirements-dev.txt
# Run locally
uvicorn src.api.main:app --reload# Format code
black src/ tests/
# Lint
ruff src/ tests/
# Type checking
mypy src/Full API documentation available at /api/docs (development mode).
POST /api/v1/query/ask- Submit natural language queryGET /api/v1/query/history- Get query history
POST /api/v1/admin/sources- Add data sourceGET /api/v1/admin/sources- List data sourcesPOST /api/v1/admin/sources/{id}/sync- Trigger syncGET /api/v1/admin/users- Manage users
See CONTRIBUTING.md for guidelines.
Proprietary - Contact for licensing information.
- Documentation:
/docs - Issues: GitHub Issues
- Email: support@example.com
- ✅ Multi-source ingestion
- ✅ Hybrid search
- ✅ LLM agnostic architecture
- ✅ Basic RBAC
- Fine-grained permission system
- Feedback-based retrieval tuning
- Usage analytics dashboard
- Cost monitoring
- Advanced query rewrit ing
- Multi-language support
Built with ❤️ for organizations that value their knowledge