How alfrescolabs/alfresco-ai-assistants works
Project Overview & Main Purpose
• The repository hosts two distinct AI assistant applications for Alfresco:
• Alfresco Docs Bot – focuses on ingesting Alfresco documentation and answering queries based solely on this content.
• Alfresco AI Assistant – interacts with a live Alfresco Content Services (ACS) instance, supporting complex workflows such as search, document transformation, redaction, report generation, etc.
• Both applications rely on an underlying Language Model (LLM), with Ollama as the primary choice, and are containerized using Docker/Docker Compose with provisions for Kubernetes deployments.
Key Components Based on the File Tree and README
a. User Interfaces:
• Two separate web UIs, one for each application:
• Docs Bot UI at http://localhost:8503.
• AI Assistant UI at http://localhost:8504.
b. Application Backend (Python Programs):
• alfresco_docs_bot.py for the Docs Bot.
• alfresco_ai_assistant.py for the AI Assistant.
• Additional supporting scripts like alfresco_api.py, commons.py, and report_writer.py.
c. LLM Service:
• A core LLM component (accessed via the LLM service, using Ollama as the containerized backend).
• Environment variables and configuration indicate integration with various LLM options.
d. API & Tools Layer (for Alfresco AI Assistant):
• API endpoints are abstracted into components like discovery-api, search-api, and node-api.
• Tools for auxiliary tasks such as discovery, transformation, and redaction.
e. Database & Data Stores:
• Additionally, a substantial “initial-load” folder provides scripts/instructions to prepare documentation and integration data for the Alfresco Docs Bot.
f. Infrastructure & Deployment:
• Docker-related files (docker-compose.yml, multiple Dockerfiles) to orchestrate service containers.
• Kubernetes configuration files under the “k8s” directory to support production-grade or cloud-based deployments.
• Environment configuration files (env.example) to manage runtime variables, particularly for connectivity with ACS, LLM, Neo4j, and other external services.
g. Auxiliary and Development Assets:
• Supporting documentation (behind_the_scenes.md and docs directory) and demo files for testing.
• Scripts folder includes transformer.py for data preparation.
How to Represent These
• Two main application nodes: “Alfresco Docs Bot” and “Alfresco AI Assistant.”
• For AI Assistant, add an “API Layer” node. Within this node, optionally partition subcomponents as “discovery-api,” “search-api,” and “node-api.”
• A “Tools” block for the AI Assistant showing subcomponents like “discovery,” “transform,” and “redact.”
b. Interactions/Relationships:
• From “User” to each UI.
• From each UI to the LLM.
• Within AI Assistant: show the query flow from the LLM to the Tools block, the invocation of API endpoints by the Tools, and the feedback loop from the API back to the LLM, then to the User.
• Interactions with external systems:
• Neo4j database accessible at http://localhost:7474, if used for graph queries.
c. Architectural Patterns:
• Use of containerization and microservices principles (each component in its own container, managed via docker-compose and Kubernetes).
• Separation of concerns: one set of services ingests and transforms documentation for the Docs Bot, while another set provides a robust API and toolset for the live ACS interactions.
• Mention that the LLM acts as a central decision-making service that interfaces with additional tools, reflecting a mediator pattern.
d. Technologies and Frameworks:
• Docker (including Docker Compose and Dockerfiles)
• Kubernetes (for production deployments with YAML configurations)
• Python (the backend services with associated scripts)
• Neo4j (graph database as shown in the environment configuration)
• Ollama LLM (and potential other LLM interfaces, as stated with environment variables)
• Embedding models, potentially using Sentence Transformer or alternatives as indicated by the EMBEDDING_MODEL variable.