On premise enterprise-grade RAG-powered agentic workflow chatbot platform with multi-provider support
- Overview
- Screenshots
- Key Features
- Architecture
- Tech Stack
- Getting Started
- Configuration
- Features in Detail
- API Documentation
- Development
- Deployment
- Contributing
- License
Sef is a modern, enterprise-ready AI chatbot platform that combines the power of Retrieval-Augmented Generation (RAG) with flexible multi-provider support and agentic tool usage system. Built with Go and Next.js, it offers a scalable solution for organizations looking to deploy intelligent conversational AI systems.
- π€ Agentic AI System: Multi-turn tool usage with real-time streaming - automatically solves complex problems
- π Enterprise Authentication: Built-in Keycloak integration for secure SSO
- π Smart Document Processing: Advanced RAG with hybrid search (semantic + keyword)
- π Multi-Provider Support: Seamlessly switch between OpenAI, Ollama, and vLLM
- π οΈ Tool Integration: Web search, document analysis, and custom tool execution
- πͺ Embeddable Widgets: Ready-to-use chat widgets for external websites
- π Internationalization: Full i18n support (English, Turkish)
- π Analytics: Comprehensive session tracking and analytics
- π¨ Modern UI: Beautiful, responsive interface built with shadcn/ui
Home Page |
Settings Page |
Provider Settings |
Chatbot Configuration |
RAG Management |
Session Logging |
Embedding Settings |
Widget System |
Tool Management |
Create New Tool |
Test Tools |
- Agentic Workflow: Autonomous problem-solving with multi-turn tool execution until task completion
- Real-time Streaming: Live SSE-based streaming of responses and tool executions
- RAG-Powered Responses: Context-aware answers using your documents
- Hybrid Search: Combines semantic similarity and keyword matching
- Smart Context Selection: Dynamic chunk selection based on query complexity
- Conversation Memory: Maintains context across multi-turn conversations
- Auto-Generated Summaries: Automatic title generation for chat sessions based on conversation content
- Advanced Chunking: Intelligent document splitting with overlap
- Vector Storage: Qdrant integration for fast semantic search
- Multiple Formats: Support for TXT, MD, and other text formats
- Embedding Generation: Automatic vectorization of documents
- OpenAI Compatible: Native support for OpenAI API
- Ollama Integration: Run models locally with Ollama
- vLLM Support: Deploy with vLLM for high-performance inference
- Per-Chatbot Configuration: Each chatbot is assigned to a specific provider
- Agentic Tool Execution: AI autonomously decides which tools to use and chains them together
- Multi-Turn Problem Solving: Continues using tools across multiple iterations until the goal is achieved
- Real-time Tool Streaming: See tool executions happening live with SSE updates
- Web Search: Integrated SearxNG for real-time web search
- Custom Tools: Extensible tool runner architecture
- API Integration: Call external APIs from conversations
- Token Optimization: TOON (Token Optimized Object Notation) support for efficient data transfer
- JQ Query Selector: Shrink JSON responses to extract only needed data
- Tool Categories: Organize tools for better management
- External Integration: Embed AI chatbots on any website with a simple script tag
- Customizable UI: Tailor widget appearance to match your brand
- Lightweight: Minimal performance impact on host websites
- Cross-Domain Support: Works seamlessly across different domains
- Easy Setup: Just add a single JavaScript snippet to your webpage
- Keycloak Integration: Enterprise SSO with role-based access control
- JWT Tokens: Secure session management
- API Key Encryption: AES encryption for sensitive credentials
- Rate Limiting: Built-in protection against abuse
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js) β
β - React 19 + TypeScript β
β - Tailwind CSS + shadcn/ui β
β - Real-time updates via SSE β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β REST API + SSE
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββ
β Backend (Go + Fiber) β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Auth Layer β β RAG Service β β Tool Runners β β
β β (Keycloak) β β β β (TOON/JQ) β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β AI Provider Manager β β
β β (OpenAI / Ollama / vLLM) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββ¬βββββββββββββ
β β β
βββββββββββΌβββββββ ββββββββββΌβββββββββ βββΌβββββββββββ
β PostgreSQL β β Qdrant β β SearxNG β
β (Main DB) β β (Vector DB) β β (Search) β
ββββββββββββββββββ βββββββββββββββββββ ββββββββββββββ
β
βββββββββββΌβββββββ
β Redis β
β (Cache) β
ββββββββββββββββββ
- Go (1.25+) - High-performance backend
- Fiber v3 - Fast HTTP framework
- GORM - Database ORM
- Qdrant - Vector database for embeddings
- Redis - Caching and session storage
- Keycloak - Identity and access management
- Next.js 16 - React framework with Turbopack
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS - Utility-first styling
- shadcn/ui - Beautiful component library
- Radix UI - Accessible primitives
- OpenAI API - GPT models
- Ollama - Local model deployment
- vLLM - High-throughput inference
- SearxNG - Privacy-respecting metasearch
- Docker & Docker Compose
- Git
- (Optional) Go 1.25+ for local development
- (Optional) Node.js 18+ for frontend development
-
Clone the repository
git clone https://github.com/yourusername/sef.git cd sef -
Start all services
# Edit needed values before starting docker-compose up -d -
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8110
- Keycloak: http://localhost:8080
- Qdrant Dashboard: http://localhost:6333/dashboard
-
Set up Keycloak (First time only)
Follow the detailed guide in docs/KEYCLOAK_SETUP.md
| Service | Port | Description |
|---|---|---|
| Frontend | 3000 | Next.js web application |
| Backend | 8110 | Go API server |
| PostgreSQL | 5432 | Main database |
| Redis | 6379 | Cache & session storage |
| Qdrant | 6333 | Vector database |
| SearxNG | 8888 | Search engine |
| Keycloak | 8080 | Authentication server |
# Application
APP_ENV=production
APP_KEY=your-secret-key-here
APP_DEBUG=false
# Database
DATABASE_HOST=postgresql
DATABASE_PORT=5432
DATABASE_NAME=sef
DATABASE_USER=sef_user
DATABASE_PASSWORD=sef_password
# Redis
REDIS_HOST=redis
REDIS_PORT=6379
# Qdrant
QDRANT_HOST=qdrant
QDRANT_PORT=6333
# Keycloak
KEYCLOAK_URL=http://keycloak:8080
KEYCLOAK_REALM=sef-realm
KEYCLOAK_CLIENT_ID=sef-client
KEYCLOAK_CLIENT_SECRET=your-client-secret
# AI Providers (Optional)
OLLAMA_HOST=localhost
OLLAMA_PORT=11434NODE_ENV=production
NEXT_PUBLIC_API_URL=http://localhost:8110- Navigate to Settings β Providers
- Click Add Provider
- Configure:
- Type: OpenAI, Ollama, or vLLM
- API Key: Your provider's API key
- Base URL: Provider endpoint
- Models: Available models
For vLLM setup, see docs/vLLM_SUPPORT.md
The RAG system enhances AI responses with your documents:
- Document Upload: Upload text files or markdown documents
- Intelligent Chunking: Documents are split into optimal chunks
- Embedding Generation: Text is converted to vector embeddings
- Hybrid Search: Queries use both semantic and keyword search
- Context Injection: Relevant chunks are added to prompts
- Smart Responses: AI generates answers using your data
- Query Analysis: Detects small talk vs. knowledge queries
- Dynamic Limits: Adjusts chunk count based on complexity
- Reranking: Filters and sorts results by relevance
- Deduplication: Removes duplicate information
Create specialized chatbots with:
- Custom system prompts
- Specific document collections
- Assigned tools and capabilities
- Dedicated provider assignment
- Temperature and parameter tuning
Built-in tools include:
- Web Search: Real-time internet search via SearxNG
- Document Query: Search your knowledge base
- API Calls: Execute HTTP requests with token optimization
- Custom Tools: Add your own via the tool runner interface
- TOON (Token Optimized Object Notation): Compact data representation that significantly reduces token usage
- JQ Query Selector: Extract specific fields from JSON responses to minimize data size
- Smart Data Filtering: Only fetch and process the data your chatbot actually needs
- Reduced Costs: Lower token consumption means reduced API costs
All API requests require authentication via Bearer token:
Authorization: Bearer <your-token>GET /api/sessions # List all sessions
POST /api/sessions # Create new session
GET /api/sessions/:id # Get session details
DELETE /api/sessions/:id # Delete sessionGET /api/sessions/:id/messages # Get messages
POST /api/sessions/:id/messages # Send messageGET /api/documents # List documents
POST /api/documents # Upload document
DELETE /api/documents/:id # Delete documentGET /api/chatbots # List chatbots
POST /api/chatbots # Create chatbot
PUT /api/chatbots/:id # Update chatbot
DELETE /api/chatbots/:id # Delete chatbotFor complete API documentation, see the API Reference.
cd backend
# Install dependencies
go mod tidy
# Start development server
go run cmd/server/main.gocd frontend
# Install dependencies
pnpm install
# Start development server
pnpm devYou might want to edit next configuration for local development.
sef/
βββ backend/
β βββ app/
β β βββ controllers/ # HTTP handlers
β β βββ entities/ # Database models
β β βββ middleware/ # Request middleware
β β βββ routes/ # Route definitions
β βββ internal/ # Internal packages
β βββ pkg/ # Reusable packages
β β βββ rag/ # RAG implementation
β β βββ providers/ # AI provider clients
β β βββ toolrunners/ # Tool execution
β β βββ ...
β βββ cmd/server/ # Entry point
β
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ hooks/ # Custom hooks
β β βββ lib/ # Utilities
β β βββ pages/ # Next.js pages
β β βββ services/ # API services
β β βββ types/ # TypeScript types
β βββ public/ # Static assets
β
βββ docs/ # Documentation
βββ docker-compose.yml # Docker setup
- Backend: Follow standard Go conventions (
gofmt,golint) - Frontend: ESLint + Prettier configured
- Commits: Use conventional commits format
# Build and start all services
docker-compose up -d --build
# View logs
docker-compose logs -f
# Stop services
docker-compose downFor HTTPS deployment:
chmod +x scripts/setup-nginx-https.sh
./scripts/setup-nginx-https.shWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Commit your changes
git commit -m 'feat: add amazing feature' - Push to your fork
git push origin feature/amazing-feature
- Open a Pull Request
- Write clean, documented code
- Add tests for new features
- Update documentation as needed
- Follow the existing code style
- Keep commits atomic and well-described
This project is licensed under the MIT License - see the LICENSE.md file for details.
Built with amazing open-source technologies:
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ by the HAVELSAN AΓ§Δ±klab
β Star us on GitHub if you find this project useful!











