MT Vector Knowledge Hub is a document retrieval and question-answering system built on modern vector database technology. The system embeds documents into a vector space using state-of-the-art language models, stores them in a PostgreSQL database, and enables semantic search and retrieval based on natural language queries. This knowledge base application leverages transformer models from Hugging Face for embeddings and LLMs from Together AI for generating responses, creating a tool for knowledge management and information retrieval.
- Vector Similarity Search: Planned; embeddings are stored but not yet queried using true vector search (e.g., pgvector)
- Document Reranking: Not yet implemented
- Full Django Migration: Some utility functions and background processing require further adaptation from the previous FastAPI/core structure
- Docker and Docker Compose
- Together AI API key
- Clone the repository
- Create a
.envfile with your Together AI API key:TOGETHER_API_KEY=your_together_api_key_here - Build and start the containers:
docker compose up --build -d
- Run migrations:
docker compose exec app python manage.py migrate - (Optional) Create a superuser for the admin interface:
docker compose exec app python manage.py createsuperuser
Once the application is running, you can access the API at http://localhost:8000.
GET /— API rootPOST /process-directory/— Process a directory of documentsPOST /generate-embeddings/— Generate vector embeddings for textPOST /chat/— Chat with the LLMGET /documents/— List documentsGET /documents/<id>/— Retrieve a document by ID
Visit http://localhost:8000/admin/ to manage documents (after creating a superuser).
The application follows a modular Django architecture:
coreapi/— Main Django app with models, views, serializers, and API logicmt_vector_kb/— Django project configuration (settings, URLs, WSGI/ASGI)docker/— Database initialization scripts
