-
Notifications
You must be signed in to change notification settings - Fork 0
Implemented REST-API and Chat Frontend #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduces a Vue.js frontend and a FastAPI backend to provide a user-friendly interface for interacting with the AI agent. This setup enables a chat-like experience similar to ChatGPT, enhancing usability for non-technical users and decoupling frontend and backend development. Includes an API key based authentication. Adds a GitHub search tool and integrates it into the agent's toolset. The agent now uses the GitHub Search tool first when a user asks something GitHub-related. Refactors the agent to be an instance, rather than global variables.
Updates the agent to incorporate an API for handling requests. This includes setting up FastAPI and defining routes for agent interaction. Integrates the GitHub knowledge base as the primary source for GitHub-related information, improving the reliability of responses. Also renames the GitHub search tool to GitHub Knowledgebase to reflect its purpose.
Enhances API security by enforcing API key validation via FastAPI dependencies. Refactors debug mode handling into a dedicated class for more controlled and explicit behavior. Removes direct debug assignment to allow runtime configuration using an argument. Adds .env loading to the test script.
Implements a new ChatGPT-like UI using HTML, CSS, and Typescript. The UI includes features such as real-time chat, local chat history and session management. Adds CORS middleware to the FastAPI backend to allow requests from the UI running on localhost:8080. Includes tests for CORS configuration and UI structure.
This commit removes the chat UI components including HTML, CSS and JavaScript files. The functionality is likely being moved or replaced.
Improves user experience by rendering agent messages using Markdown. This change adds the `marked` library to render Markdown content in assistant messages, allowing for richer formatting and improved readability. User messages remain as plain text for security reasons.
Adds session deletion functionality and ensures a new session is created only when no existing sessions are available. Loads the most recent session if sessions exist.
Refactors test suite to include project root in the Python path, ensuring correct module resolution during testing. Adds integration tests for API endpoints, focusing on agent interactions and error handling scenarios. Updates the UI tests to reflect the move of compiled js files to the /dist directory, as well as correcting the default API endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR cleans up outdated example content, tightens prompt guardrails, and updates configuration to support the new REST API and frontend integration.
- Removed legacy tutorials, reference guides, and example scripts to streamline the repository.
- Refined
.githubprompts to enforce strict file-modification guardrails. - Updated Docker Compose to drop an unused UI port mapping for MemGraph.
Reviewed Changes
Copilot reviewed 20 out of 61 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/data/tutorials/neural_networks_explained.html | Deleted outdated neural network tutorial |
| examples/data/tutorials/data_visualization.md | Deleted outdated data visualization tutorial |
| examples/data/tutorials/data_preprocessing.txt | Deleted outdated data preprocessing tutorial |
| examples/data/reference/vector_embeddings.md | Deleted outdated vector embeddings reference |
| examples/data/reference/model_deployment.json | Deleted outdated model deployment reference |
| examples/data/reference/ml_frameworks.json | Deleted outdated ML frameworks reference |
| examples/data/reference/ml_datasets.csv | Deleted outdated ML datasets CSV |
| examples/data/reference/graph_databases.md | Deleted outdated graph databases reference |
| examples/data/reference/data_visualization.yaml | Deleted outdated YAML visualization reference |
| examples/data/reference/cloud_ml_services.xml | Deleted outdated cloud ML services XML |
| examples/data/docs/reinforcement_learning.md | Deleted outdated reinforcement learning overview |
| examples/data/docs/introduction_to_ml.md | Deleted outdated machine learning introduction |
| examples/data/blogs/nlp_advancements.md | Deleted outdated NLP blog post |
| examples/data/blogs/ai_ethics_considerations.md | Deleted outdated AI ethics blog post |
| examples/9-test.py | Removed unused example test code |
| docs/ADRs/rest-api-integration.md | Added new ADR for REST API integration |
| docs/ADRs/frontend-integration.md | Added new ADR for Vue.js frontend integration |
| docker/docker-compose.yml | Removed unnecessary MemGraph Lab UI port mapping |
| .github/prompts/planner.prompt.md | Strengthened guardrails to only allow modifications in docs/.planning/ |
| .github/prompts/architect.prompt.md | Strengthened guardrails to only allow modifications in docs/ADRs/ |
Removes the separate UI serving script and integrates the UI directly into the API server using FastAPI's static file serving capabilities. Updates the README to reflect the new UI integration, providing instructions for building and running the UI within the API. This simplifies the deployment process and ensures the UI is served consistently. Also updates a tool name in README to be more accurate.
Improves the UI serving by correctly setting the MIME type for JavaScript files. Refactors UI tests to use FastAPI's test client for better integration testing. Removes the dedicated UI server setup and CORS tests as the UI is now served by the main API. Adds a test Azure API key for test coverage runs to avoid missing coverage.
Configures the test workflow to load environment variables from the .env.example file. This ensures tests use consistent configurations and avoids hardcoding test values.
Adds a step to install npm dependencies and build the UI during the test coverage workflow. This ensures that UI-related checks are included in the test coverage reports. Reduces the minimum coverage threshold to 75%.
Updates the npm script used for building the user interface in the test coverage workflow. This change improves clarity and consistency by using a more descriptive script name.
Adds mocking to API integration tests to prevent reliance on external services and ensure consistent test results. This allows for more reliable and faster tests. Also, improves the `test_ask_endpoint_with_valid_api_key` test by making the assertion on the response content more robust by checking for "location" instead of an exact phrase match.
Deletes the separate API integration and route tests. These tests are no longer needed since the core API functionality is now covered by other test suites.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to improve architectural decision-making, refine guardrails for specific roles, and update the codebase and documentation. The most significant updates include stricter constraints for file modifications in role-specific prompts, removal of outdated files, and the addition of new Architecture Decision Records (ADRs) for frontend and REST API integration.
Guardrail Enforcement
.github/prompts/architect.prompt.md: Added explicit instructions prohibiting the creation or modification of files outside thedocs/ADRs/directory. Updated the "Documentation-Only" operating principle to emphasize that no other file changes are permitted. [1] [2].github/prompts/planner.prompt.md: Added restrictions to prevent file modifications outsidedocs/.planning/, specifying that onlyclarification.mdandtasks.mdare allowed. [1] [2]Architectural Documentation
docs/ADRs/frontend-integration.md: Added a new ADR proposing the integration of a Vue.js frontend to improve user interaction with the AI agent via a graphical interface.docs/ADRs/rest-api-integration.md: Added a new ADR detailing the decision to integrate a REST API using FastAPI for broader accessibility and interaction with the AI agent.Code Cleanup
examples/9-test.py: Removed unused test code related to vector search, RAG, and LLM interactions, including initialization of clients and asynchronous methods for handling conversations and vector search.examples/data/blogs/ai_ethics_considerations.md: Deleted outdated content discussing ethical considerations in AI development.Configuration Update
docker/docker-compose.yml: Removed the port mapping for MemGraph Lab UI (3000:3000) as it is no longer required.