|
|
před 6 hodinami | |
|---|---|---|
| .. | ||
| scripts | před 2 týdny | |
| src | před 6 hodinami | |
| .dockerignore | před 2 týdny | |
| .env.sample | před 1 týdnem | |
| .prettierrc | před 3 týdny | |
| Dockerfile | před 6 hodinami | |
| README.md | před 1 týdnem | |
| build_output.txt | před 1 týdnem | |
| check_schema.js | před 2 týdny | |
| chi_sim.traineddata | před 3 týdny | |
| database.sqlite | před 2 týdny | |
| debug_es.js | před 2 týdny | |
| eng.traineddata | před 3 týdny | |
| es_results.txt | před 2 týdny | |
| eslint.config.mjs | před 3 týdny | |
| jpn.traineddata | před 3 týdny | |
| metadata.db | před 2 týdny | |
| nest-cli.json | před 3 týdny | |
| package.json | před 1 týdnem | |
| pdf_to_images.py | před 1 týdnem | |
| schema_output.txt | před 2 týdny | |
| test_db.py | před 2 týdny | |
| test_output.txt | před 1 týdnem | |
| tsconfig.build.json | před 2 týdny | |
| tsconfig.build.tsbuildinfo | před 1 týdnem | |
| tsconfig.json | před 2 týdny | |
| tsconfig.tsbuildinfo | před 1 týdnem | |
| yarn.lock | před 3 týdny | |
A RAG (Retrieval-Augmented Generation) knowledge base backend system built with the NestJS framework. Provides file parsing, vector indexing, hybrid search, and multi-model management features.
Before running the project, ensure you have the following environment set up:
Use the docker-compose.yml file in the project root (simple-kb/) to quickly start Elasticsearch and Tika.
# Run from project root directory
docker-compose up -d
After successful startup:
19200 (maps container's 9200 port)9998Navigate to the server directory and install packages:
cd server
yarn install
The project uses environment variables for configuration. Make sure the settings are correct (especially Elasticsearch address):
# Database path
DATABASE_PATH=server/data/metadata.db
# JWT secret
JWT_SECRET=your_secure_secret
# Elasticsearch settings (match docker-compose ports)
ELASTICSEARCH_HOST=http://localhost:19200
ELASTICSEARCH_INDEX=knowledge_base
# Tika settings
TIKA_HOST=http://localhost:9998
# File upload storage path
UPLOAD_FILE_PATH=./uploads
# Development mode (recommended, with hot reload)
yarn run start:dev
# Build and run in production mode
yarn build
yarn run start:prod
The backend service runs on http://localhost:13000 by default, with API prefix /api.
# Unit tests
yarn run test
# E2E tests
yarn run test:e2e
Database Initialization:
metadata.db (or configured DB) under the server/data/ directory.synchronize: true, table structures are auto-synced.Elasticsearch Connection:
Connection refused error, check if Docker containers are running properly (docker ps).knowledge_base is automatically detected and created.Default Account:
File Parsing: