A modern knowledge management system that transforms documents into structured knowledge using AI. Built with React, FastAPI, and TypeScript.
- Document Processing: Upload and process PDF, PPT, Word, and text files
- AI-Powered Analysis: Generate knowledge using multiple AI providers (OpenAI, Anthropic, Gemini, LMStudio)
- Knowledge Matrix:
- Create matrix definitions to combine multiple groups
- Real-time web interface display with interactive tables
- Excel export with rows as records, columns as prompts, cells as knowledge
- Support for plain knowledge text extraction
- User Management: Multi-user support with role-based access control
- RESTful API: Complete API access for all functionality
- Responsive Design: Works seamlessly on desktop and mobile devices
- Node.js 18+ and npm/yarn/pnpm
- Python 3.8+ with Poetry
- Git
- Clone the repository:
git clone https://github.com/daishir0/LLMKnowledge3.git
cd LLMKnowledge3- Install backend dependencies:
cd backend
poetry install- Install frontend dependencies:
cd ../frontend
npm install- Set up environment variables:
# Copy the example environment file
cp .env.example .env
# Edit .env with your configurationStart both backend and frontend with a single command:
# From the root directory
npm run devOr start them separately:
# Terminal 1 - Backend
cd backend
poetry run uvicorn app.main:app --reload --port 8000
# Terminal 2 - Frontend
cd frontend
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Email: admin@example.com
- Password: admin123
- Authentication: JWT-based with role management
- Database: SQLite (default) or PostgreSQL
- AI Integration: Multiple provider support
- File Processing: Integrated MarkItDown library for document conversion
- API: RESTful endpoints with OpenAPI documentation
- UI Framework: Tailwind CSS + shadcn/ui
- State Management: React Context
- Routing: React Router
- Build Tool: Vite
LLMKnowledge3 supports five main usage patterns:
- Upload multiple PDF research papers
- Create analysis prompts (summary, key findings, methodology)
- Generate comparative knowledge matrix
- Upload project proposal documents
- Define evaluation criteria prompts (1-5 scale ratings)
- Generate evaluation matrix for decision making
- Upload news text files
- Create SEO-optimized content prompts
- Generate markdown articles for publication
- Process files from directories
- Create security evaluation prompts
- Assess personal information, security risks, and public disclosure readiness
- Upload student assignment files
- Create rubric-based evaluation prompts
- Generate scoring matrix for grading
All functionality is available via RESTful API:
# Authentication
POST /auth/login
POST /auth/register
# Groups
GET /groups
POST /groups
PUT /groups/{id}
DELETE /groups/{id}
# Records (Documents)
GET /records
POST /records
POST /records/upload
PUT /records/{id}
DELETE /records/{id}
# Prompts
GET /prompts
POST /prompts
PUT /prompts/{id}
DELETE /prompts/{id}
# Tasks
GET /tasks
POST /tasks
DELETE /tasks/{id}
GET /tasks/status
# Knowledge
GET /knowledge
DELETE /knowledge/{id}
# Matrix
GET /matrix/definitions # List matrix definitions
POST /matrix/definitions # Create matrix definition
PUT /matrix/definitions/{id} # Update matrix definition
DELETE /matrix/definitions/{id} # Delete matrix definition
GET /matrix/view/{id} # View matrix data
GET /matrix/export/{id}/excel # Export matrix to Excel
GET /matrix/legacy # Legacy matrix endpoint
# Admin
GET /admin/users
PUT /admin/users/{id}
GET /admin/statsCopy .env.example to .env and configure as needed:
cp .env.example .envKey configuration options:
DATABASE_URL: SQLite (default) or PostgreSQL connection stringSECRET_KEY: JWT signing key (change in production)OPENAI_API_KEY: For OpenAI integration (optional)ADMIN_USERNAME/EMAIL/PASSWORD: Default admin account credentialsALLOWED_ORIGINS: CORS allowed origins for frontendMAX_FILE_SIZE: Maximum file size for document uploads (default: 50MB)
See .env.example for all available configuration options.
The application automatically creates the database and tables on first run. To use PostgreSQL instead of SQLite, update the DATABASE_URL in your .env file.
Run the comprehensive test suite:
# Backend tests
cd backend
poetry run pytest
# Frontend tests
cd frontend
npm test
# Integration tests (requires running application)
python tests/test_scenarios.pyLLMKnowledge3/
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── routers/ # API endpoints
│ │ ├── models.py # Database models
│ │ ├── schemas.py # Pydantic schemas
│ │ ├── auth.py # Authentication
│ │ ├── services.py # Business logic
│ │ └── main.py # Application entry
│ ├── tests/ # Backend tests
│ └── pyproject.toml # Python dependencies
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── contexts/ # React contexts
│ │ ├── lib/ # Utilities
│ │ └── types/ # TypeScript types
│ ├── public/ # Static assets
│ └── package.json # Node dependencies
├── tests/ # Integration tests
└── docs/ # Documentation
- Backend: Add routes in
app/routers/, update models/schemas as needed - Frontend: Create components in
src/components/or pages insrc/pages/ - API Integration: Update
src/lib/api.tswith new endpoints - Types: Add TypeScript interfaces in
src/types/index.ts
- JWT-based authentication with secure token handling
- Role-based access control (admin/user)
- Input validation and sanitization
- CORS configuration
- Rate limiting on API endpoints
- Secure file upload handling
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes and add tests
- Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support:
- Create an issue on GitHub
- Check the API documentation at
/docs - Review the test scenarios in
/tests
- Complete rewrite in React + FastAPI
- NEW: Matrix Definition System - Create reusable matrix configurations
- NEW: Interactive Matrix Display - Real-time web interface with table view
- Enhanced Excel Export - Proper matrix format (rows=records, columns=prompts, cells=knowledge)
- Plain Knowledge Support - Extract and display original text alongside AI-generated knowledge
- Integrated MarkItDown Library - Direct document processing without external server dependency
- Improved user management and authentication
- Enhanced AI provider support
- Mobile-responsive design
- Comprehensive test coverage