### Quick Demo Setup and Execution Source: https://github.com/cmakafui/vtt-challenge/blob/main/docs/SOLUTION.md Provides bash commands to set up the development environment and run the VTT challenge project. This includes installing necessary tools like uv and Bun, installing project dependencies, starting services via Docker Compose, running the MCP server, and executing the main pipeline analysis script. ```bash # Install dependencies curl -LsSf https://astral.sh/uv/install.sh | sh curl -fsSL https://bun.sh/install | bash uv sync && cd agents && bun install # Start services docker compose up -d uv run fastmcp run mcp/innovation_entity_server.py --transport sse --port 9000 # Run pipeline uv run python scripts/ambiguity_analysis.py analyze bun run agents/innovation-curator-agent.ts results.json ``` -------------------------------- ### Quick Demo: Install Dependencies and Run Pipeline Source: https://github.com/cmakafui/vtt-challenge/blob/main/README.md This sequence of bash commands demonstrates how to set up the project environment, install necessary dependencies using uv and Bun, start the required services via Docker Compose, and then execute the main pipeline analysis and agent curation scripts. ```bash cd pipeline # Install dependencies curl -LsSf https://astral.sh/uv/install.sh | sh curl -fsSL https://bun.sh/install | bash uv sync && bun install # Start services docker compose up -d uv run fastmcp run mcp/innovation_entity_server.py --transport sse --port 9000 # Run pipeline uv run python scripts/innovations_analysis.py analyze bun run agents/innovation-curator-agent.ts results.json ``` -------------------------------- ### Start MCP Server and LLM Agent Source: https://github.com/cmakafui/vtt-challenge/blob/main/docs/SOLUTION.md Initiates the MCP server for graph operations and then launches the intelligent curation agent. The agent uses GPT-4.1-mini to analyze candidate pairs and make SAME/DIFFERENT decisions with confidence scoring. ```bash # Start MCP server for graph operations uv run fastmcp run mcp/innovation_entity_server.py --transport sse --port 9000 # Run intelligent curation agent bun run agents/innovation-curator-agent.ts duplicates.json ``` -------------------------------- ### Install Project Dependencies (Bash) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Installs necessary tools and libraries for the project. This includes `uv` for Python package management, `Bun` for the TypeScript agent, and syncing Python dependencies. ```bash # Install uv if needed curl -LsSf https://astral.sh/uv/install.sh | sh # Install Bun for the LLM agent curl -fsSL https://bun.sh/install | bash # Sync Python dependencies uv sync # Install TypeScript agent dependencies bun install ``` -------------------------------- ### LLM Prompt for Innovation Comparison Source: https://github.com/cmakafui/vtt-challenge/blob/main/docs/SOLUTION.md A TypeScript example demonstrating the rich context provided to the GPT-4.1-mini agent for comparing innovation candidates. The prompt guides the LLM to consider technical details, organizational context, source metadata, language variations, and project phases. ```typescript // Rich context analysis for each candidate pair const prompt = ` Compare these innovations considering: - Technical descriptions and core methods - Organizational contexts and roles - Source URLs and publication metadata - Language variations (EN/FI) - Project phases vs. distinct innovations `; ``` -------------------------------- ### Azure OpenAI Configuration Example (JSON) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Provides a template for the `azure_config.json` file, detailing the necessary parameters for connecting to Azure OpenAI services. This includes API keys, versions, base URLs, and deployment names for models and embeddings. ```json { "gpt-4o-mini": { "api_key": "your-azure-openai-api-key", "api_version": "2024-02-01", "api_base": "https://your-instance.openai.azure.com/", "emb_deployment": "your-embedding-deployment-name" } } ``` -------------------------------- ### Start Memgraph and MCP Services (Bash) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Initiates the core services required for the pipeline. This involves starting the Memgraph graph database using Docker Compose and launching the MCP server. ```bash # Start Memgraph database docker compose up -d # Start MCP server uv run fastmcp run mcp/innovation_entity_server.py --transport sse --port 9000 ``` -------------------------------- ### Run LLM Curation Agent & MCP Server (Bash) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Starts the Model Context Protocol (MCP) server for graph operations and runs the LLM curation agent. The agent uses GPT-4.1 for disambiguation decisions and orchestrates MCP tools. It requires Node.js (via Bun) and the MCP server setup. ```bash # Start MCP server uv run fastmcp run mcp/innovation_entity_server.py --transport sse --port 9000 # Run LLM curation agent bun run agents/innovation-curator-agent.ts duplicates.json ``` -------------------------------- ### Memgraph 'Thick Edge' Schema Example Source: https://github.com/cmakafui/vtt-challenge/blob/main/docs/SOLUTION.md Illustrates the Memgraph schema using Cypher, specifically showcasing the 'thick edge' concept to preserve complete provenance. It details how an organization is linked to an innovation with metadata about each mention, including source URLs and roles. ```cypher (VTT:Organization)-[:INVOLVED_IN { mentions: [ { name_in_mention: "Solar Foods protein tech", source_url: "https://vtt.fi/news/solarfoods", role_in_mention: "Lead Developer", publication_date: "2023-01-15" }, { name_in_mention: "Air protein technology", source_url: "https://partner.com/collaboration", role_in_mention: "Research Partner" } ], primary_role: "Lead Developer" }]->(ProteinSynthesis:Innovation) ``` -------------------------------- ### Run FAISS Similarity Analysis Source: https://github.com/cmakafui/vtt-challenge/blob/main/docs/SOLUTION.md Executes the FAISS script for identifying potential innovation duplicates. This command analyzes GraphDocument extractions, generates embeddings, and performs high-performance similarity searches to find candidate duplicate pairs. ```bash uv run python scripts/innovations_analysis.py analyze \ --similarity-threshold 0.80 \ --dimensions 1024 ``` -------------------------------- ### Configure Environment Variables (Bash) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Sets up essential environment variables for connecting to services and configuring the pipeline. This includes database connection strings, API keys, and deployment names for Azure OpenAI. ```bash # Memgraph Configuration export MEMGRAPH_HOST="bolt://localhost:7687" # Azure OpenAI Configuration export AZURE_CONFIG_PATH="/path/to/azure_config.json" export AZURE_MODEL_KEY="gpt-4.1-mini" export EMBEDDING_DIMENSION="1024" # MCP Server Configuration export FASTMCP_SERVER_PORT="9000" ``` -------------------------------- ### Pipeline Dependencies Source: https://github.com/cmakafui/vtt-challenge/blob/main/docs/SOLUTION.md Lists the key software dependencies required for different components of the VTT innovation pipeline. It categorizes dependencies for the main pipeline processing, the MCP server, and the LLM agent. ```json { "pipeline": ["faiss-cpu", "openai", "pandas", "typer", "rich"], "mcp_server": ["fastmcp", "neo4j", "pydantic"], "agent": ["@ai-sdk/azure", "commander", "chalk", "zod"] } ``` -------------------------------- ### Run VTT Innovation Analysis (Bash) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Executes the Python script for semantic analysis of innovation data. It identifies potential duplicates using FAISS similarity search with configurable thresholds and batch sizes. Dependencies include Python, Azure OpenAI, and FAISS. ```bash uv run python scripts/innovations_analysis.py analyze \ --vtt-data-dir "data/graph_docs_vtt_domain/" \ --partner-data-dir "data/graph_docs_partners/" \ --similarity-threshold 0.80 \ --batch-size 50 # View tool information uv run python scripts/innovations_analysis.py info ``` -------------------------------- ### Ingest Canonical Entities into Memgraph Source: https://github.com/cmakafui/vtt-challenge/blob/main/docs/SOLUTION.md Batches and loads the resolved canonical innovation entities into the Memgraph database. This script ensures a clean knowledge graph is populated while preserving complete audit trails through 'thick edges'. ```bash # Batch populate resolved entities uv run python scripts/ingest_entities.py ingest glossary.json duplicates.json ``` -------------------------------- ### MCP Server Tools for Innovation Curation (APIDOC) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Defines the core functionalities provided by the Model Context Protocol (MCP) server for managing innovation entities. These tools enable smart entity resolution, organization management, linking, semantic search, and merging of duplicate innovations within the knowledge graph. ```APIDOC MCP Server Tools: resolve_or_create_canonical_innovation(innovation_data: dict) -> dict - Resolves existing canonical innovation entities or creates new ones based on provided data. - Parameters: - innovation_data: Dictionary containing details of the innovation (e.g., name, description, source). - Returns: Dictionary representing the canonical innovation entity. resolve_or_create_organization(organization_data: dict) -> dict - Manages organization entities, resolving existing ones by VAT ID or creating new ones. - Parameters: - organization_data: Dictionary containing organization details (e.g., name, VAT ID). - Returns: Dictionary representing the organization entity. add_mention_to_link(innovation_id: str, organization_id: str, provenance: dict) -> bool - Links organizations to specific innovation mentions, including full provenance information. - Parameters: - innovation_id: Identifier of the innovation. - organization_id: Identifier of the organization. - provenance: Dictionary detailing the source and context of the mention. - Returns: Boolean indicating success. search_similar_innovations(embedding: list, limit: int = 10) -> list - Performs semantic similarity search for innovations using provided embeddings. - Parameters: - embedding: Numerical vector representing the innovation's semantic features. - limit: Maximum number of similar innovations to return. - Returns: List of dictionaries, each representing a similar innovation. merge_innovations(innovation_ids: list[str], canonical_id: str) -> bool - Consolidates multiple duplicate innovation entities into a single canonical entity. - Parameters: - innovation_ids: List of identifiers for duplicate innovations. - canonical_id: Identifier for the target canonical innovation. - Returns: Boolean indicating success. ``` -------------------------------- ### Batch Ingest Resolved Entities to Memgraph (Bash) Source: https://github.com/cmakafui/vtt-challenge/blob/main/pipeline/README.md Loads resolved entities, including organization glossaries and duplicate resolution results, into the Memgraph database. This script is optimized for high-performance batch operations and includes progress reporting and error handling. ```bash uv run python scripts/ingest_entities.py ingest \ glossary.json \ duplicates.json \ --batch-size 100 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.