SynFAQ is an intelligent B2B SaaS platform designed for creating, managing, and integrating smart Knowledge Bases and FAQ sections. Powered by advanced Machine Learning, semantic search, and Generative AI, SynFAQ ensures users find the right answers even when their search queries are vague, misspelled, or use colloquial language.
- Multi-Project Account Dashboard: Manage multiple independent FAQ environments for different business units from a single, elegant workspace.
- Granular Metrics Monitoring: Track active knowledge bases, global question counters, and creation dates seamlessly.
- Flexible FAQ Onboarding: Choose between instant automated generation or manual initialization of an empty knowledge base structure.
- AI-Powered Generation & File Ingestion: Instantly parse corporate descriptions or extract data from uploaded files (.txt, .pdf, .docx) using advanced LLMs via OpenRouter to build complex QA trees.
- Dynamic Range Limits: Control token consumption and generation density by requesting between 5 and 20 targeted questions per session.
- Complete CRUD Dashboard: Clean interactive layout to manually add questions, manage categories, append tag sets, or edit data fields before deployment.
- Synonym Mapping: Explicitly map alternative search phrases to individual questions to fine-tune context-based retrieval probability.
- Intelligent Semantic Search: Context-aware search framework focusing on string intentions rather than static keyword evaluation.
- Voice Search (MVP): Native audio interface integration enabling users to dictate search queries directly inside widgets.
- Categorized Layout Routing: Fluid UI component filtering with responsive chips and clean accordion wrappers.
- Frontend: React, TypeScript, Vite, Tailwind CSS
- Backend: Python, FastAPI, Pydantic (Strict configuration and data validation layer)
- Database: PostgreSQL (Relational schema storage)
- AI/ML Core: Local semantic retrieval powered by
sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2(multilingual dense vector embeddings & similarity scoring), paired with OpenRouter Hub Orchestration (Gemma 4 26B/Llama 3.3) for automated FAQ tree generation. Features a highly resilient routing setup automatically cascading to backup clusters to prevent upstream HTTP 429 rate-limit exceptions. - Deployment: Docker Compose (PostgreSQL + FastAPI + Nginx serving the built frontend)
InteractiveFAQ/
├── backend/ # FastAPI Application Source Code
│ ├── app/
│ │ ├── api/ # REST Route Controllers (Endpoints)
│ │ ├── core/ # Security: password hashing, JWT, API keys
│ │ ├── database/ # Database connection and session
│ │ ├── ml/ # Semantic search model
│ │ ├── models/ # SQLAlchemy Database Models
│ │ └── schemas/ # Pydantic Schemas (Request/Response Validation)
│ ├── seed.py # Recreates the database and fills it with demo data
│ ├── requirements.txt
│ ├── Dockerfile
│ └── .env.example
├── frontend/ # React Client Application
│ ├── src/
│ ├── package.json
│ ├── nginx.conf
│ ├── Dockerfile
│ └── .env.example
├── docker-compose.yml
└── README.md
There are two ways to run the project. Docker is the easiest: one command starts the database, the backend and the frontend. The manual setup is more convenient if you are actively changing the code.
Prerequisites: Git and Docker Desktop (running).
- Clone the repository:
git clone https://github.com/nleaxy/InteractiveFAQ.git
cd InteractiveFAQ- Create
backend/.envfrom the example:
# Windows (PowerShell):
copy backend\.env.example backend\.env
# macOS/Linux:
cp backend/.env.example backend/.envKeep db as the host in DATABASE_URL, fill in JWT_SECRET and, if you need AI generation, OPENROUTER_API_KEY.
- Build and start all services:
docker compose up -d --buildThe first build takes a while (Python and Node dependencies). On the first start the backend also downloads the search model (~0.5 GB), so the frontend starts only after the backend becomes healthy. You can follow the progress with docker compose logs -f backend.
- Fill the database with demo data (only once, see the warning below):
docker compose exec backend python seed.py- Open
http://localhostand log in with the demo account:admin@example.com/admin123.
Stopping and starting again:
docker compose stop # stop, keeping containers, data and the downloaded model
docker compose start # start again (about 1–2 minutes until the backend is ready)docker compose down is also safe for your data, but removes the containers, so the search model will be downloaded again. Never use docker compose down -v: it deletes the database volume.
Prerequisites:
- Python 3.10–3.12 (
torch==2.3.1does not support Python 3.13) - Node.js 18+ and npm
- PostgreSQL
Create a user and a database (for example in psql as the postgres user):
CREATE USER faq_user WITH PASSWORD 'faq_password';
CREATE DATABASE faq_db OWNER faq_user;If you have Docker, you can start only the database instead: docker compose up -d db.
cd backend
python -m venv venv
# Windows:
.\venv\Scripts\Activate.ps1
# macOS/Linux:
source venv/bin/activate
pip install -r requirements.txtOn Windows, if the virtual environment cannot be activated, run once: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.
Create backend/.env from backend/.env.example and change the host in DATABASE_URL to localhost:
DATABASE_URL=postgresql://faq_user:faq_password@localhost:5432/faq_db
OPENROUTER_API_KEY=
JWT_SECRET=any_long_random_string
Fill the database with demo data and start the server:
python seed.py
uvicorn app.main:app --reloadOn the first start the search model is downloaded. The server is ready when the log shows "ML модель успешно загружена". Interactive API docs: http://127.0.0.1:8000/docs.
In a second terminal:
cd frontend
# Windows:
copy .env.example .env
# macOS/Linux:
cp .env.example .env
npm install
npm run devOpen http://localhost:5173 and log in with admin@example.com / admin123.
seed.pydrops all tables and recreates them with demo data. Run it only once, otherwise all projects you created will be lost.- AI generation requires
OPENROUTER_API_KEY(get one at openrouter.ai). Without it, everything else works: projects, manual FAQ editing and semantic search. .envfiles are in.gitignore. Never commit your keys.
SynFAQ exposes a production-ready developer ecosystem allowing businesses to fetch external integrations and bridge their customer service widgets to the main semantic knowledge model. The full interactive reference is available at /docs on the backend.
Authorized with the project's API key in the X-API-Key header.
GET /api/v1/faqs- Fetch all FAQ entries of the project.POST /api/v1/faqs- Create a QA item with search synonyms.PUT /api/v1/faqs/{faqId}- Modify an existing entry.DELETE /api/v1/faqs/{faqId}- Delete an entry.GET /api/v1/search?query=your_search_term&threshold=0.6- Semantic search within the project.
POST /api/projects/v1/generate/?project_id={id}- Generate from a text description:
{
"description": "Your business details or system specs...",
"count": 7
}POST /api/projects/v1/generate/file?project_id={id}- Generate from an uploaded.txt,.pdfor.docxfile (multipart form:file,count).
Note: count must be an integer between 5 and 20.
- Endpoint:
GET /api/projects/search?project_id={id}&query=your_search_term&threshold=0.6 - Behavior: Evaluates the string against both the canonical question strings and the bound synonym array utilizing similarity score matrix rankings.
- Enhance conversational tone adapters inside the AI generation layer.
- Implement native bulk data imports (.json, existing FAQ pages).
- Introduce real-time analytics dashboard to track user queries and search misses.
- Full mobile responsive optimizations for the admin viewport.
- Multi-tenant cloud workspace implementation.
- Team Lead / Backend Architect
- Product Manager / Frontend Developer
- Project Manager / Frontend Developer
- DevOps & QA / Backend Developer
- Business Analyst
This repository was engineered explicitly for academic practice purposes. All rights reserved.

