This project is a Java-based Intelligent Document Management System (DMS) that leverages cutting-edge AI technologies to revolutionize the way you manage and interact with documents. It incorporates advanced features powered by artificial intelligence to offer unparalleled efficiency and productivity.
Our primary objective is to empower users with the ability to interact with the document repository conversationally. By leveraging Language Model-based Systems (LLMs), our DMS allows users to query the repository in a natural and conversational manner
The system aims to intelligently categorizes, searches, and analyzes your documents, allowing you to focus on what truly matters. Our system leverages cutting-edge AI technologies to revolutionize the way you manage and interact with documents.
This project employs a blend of architectural patterns, incorporating Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), hexagonal architecture, and Domain Events. It has been enhanced to include support for Elasticsearch, providing powerful search capabilities directly integrated with the Java API Client recommended for Spring Boot 3.x applications.
Additionally, support for Spring AI using OpenAI has been added to perform retrieval augmented generation. This is facilitated by utilizing the pgVector extension for PostgreSQL as our vector store, seamlessly integrated into the document lifecycle when adding a new document.
To use this project, you should create an OpenAI account ,if you don't already have one, and store your OpenAI key in the application.yaml
file. In my case, I used an environment variable called OPENAI_API_KEY
.
You can also adapt the model to use via the property spring.ai.openai.chat.model
.
spring:
ai:
openai:
api-key: ${OPENAI_API_KEY}
chat:
model: "gpt-3.5-turbo-1106"
Make sure to replace "gpt-3.5-turbo-1106"
,that I am using, with the model you intend to use for chat generation.
Liquibase is used to manage database migrations and schema changes. Changesets are organized in the src/main/resources/db/changelog
directory, allowing for structured and version-controlled database updates.
- Container Name: spring-pgadmin
- URL: http://localhost:8088/browser/
- Username: [email protected]
- Password: toor
Configure pgAdmin to connect to the PostgreSQL instance as shown in the image below:
- Container Name: spring-postgresql
- URL: http://localhost:5432/
- Password: toor
- Port: 5432
The project now includes Elasticsearch support, utilizing the Java API Client which is the recommended approach for Spring Boot 3.x versions. This is in response to the deprecation of the High Level REST Client in favor of the Java API Client since Elasticsearch 7.15.0. Basic Add and Get operations on Elasticsearch documents have been implemented.
- Elasticsearch URL: http://localhost:9200/
- Query Documents: http://localhost:9200/document/_search?size=1000
The application can be accessed at:
Explore the API using Swagger UI at:
To ensure Elasticsearch runs smoothly on Docker for Windows, especially within a WSL2 environment, execute the following commands:
wsl -d docker-desktop
sysctl -w vm.max_map_count=262144
sysctl vm.max_map_count
If you have any questions, encounter issues, or need assistance with this project, please don't hesitate to open an issue on GitHub.
Alternatively, you can reach out to us via email at:
We're committed to addressing your concerns and providing the support you need to ensure your experience with this project is smooth and successful.