* feat: Implement multi-tenant architecture with tenant and knowledge base models - Added data models for tenants, knowledge bases, and related configurations. - Introduced role and permission management for users in the multi-tenant system. - Created a service layer for managing tenants and knowledge bases, including CRUD operations. - Developed a tenant-aware instance manager for LightRAG with caching and isolation features. - Added a migration script to transition existing workspace-based deployments to the new multi-tenant architecture. * chore: ignore lightrag/api/webui/assets/ directory * chore: stop tracking lightrag/api/webui/assets (ignore in .gitignore) * feat: Initialize LightRAG Multi-Tenant Stack with PostgreSQL - Added README.md for project overview, setup instructions, and architecture details. - Created docker-compose.yml to define services: PostgreSQL, Redis, LightRAG API, and Web UI. - Introduced env.example for environment variable configuration. - Implemented init-postgres.sql for PostgreSQL schema initialization with multi-tenant support. - Added reproduce_issue.py for testing default tenant access via API. * feat: Enhance TenantSelector and update related components for improved multi-tenant support * feat: Enhance testing capabilities and update documentation - Updated Makefile to include new test commands for various modes (compatibility, isolation, multi-tenant, security, coverage, and dry-run). - Modified API health check endpoint in Makefile to reflect new port configuration. - Updated QUICK_START.md and README.md to reflect changes in service URLs and ports. - Added environment variables for testing modes in env.example. - Introduced run_all_tests.sh script to automate testing across different modes. - Created conftest.py for pytest configuration, including database fixtures and mock services. - Implemented database helper functions for streamlined database operations in tests. - Added test collection hooks to skip tests based on the current MULTITENANT_MODE. * feat: Implement multi-tenant support with demo mode enabled by default - Added multi-tenant configuration to the environment and Docker setup. - Created pre-configured demo tenants (acme-corp and techstart) for testing. - Updated API endpoints to support tenant-specific data access. - Enhanced Makefile commands for better service management and database operations. - Introduced user-tenant membership system with role-based access control. - Added comprehensive documentation for multi-tenant setup and usage. - Fixed issues with document visibility in multi-tenant environments. - Implemented necessary database migrations for user memberships and legacy support. * feat(audit): Add final audit report for multi-tenant implementation - Documented overall assessment, architecture overview, test results, security findings, and recommendations. - Included detailed findings on critical security issues and architectural concerns. fix(security): Implement security fixes based on audit findings - Removed global RAG fallback and enforced strict tenant context. - Configured super-admin access and required user authentication for tenant access. - Cleared localStorage on logout and improved error handling in WebUI. chore(logs): Create task logs for audit and security fixes implementation - Documented actions, decisions, and next steps for both audit and security fixes. - Summarized test results and remaining recommendations. chore(scripts): Enhance development stack management scripts - Added scripts for cleaning, starting, and stopping the development stack. - Improved output messages and ensured graceful shutdown of services. feat(starter): Initialize PostgreSQL with AGE extension support - Created initialization scripts for PostgreSQL extensions including uuid-ossp, vector, and AGE. - Ensured successful installation and verification of extensions. * feat: Implement auto-select for first tenant and KB on initial load in WebUI - Removed WEBUI_INITIAL_STATE_FIX.md as the issue is resolved. - Added useTenantInitialization hook to automatically select the first available tenant and KB on app load. - Integrated the new hook into the Root component of the WebUI. - Updated RetrievalTesting component to ensure a KB is selected before allowing user interaction. - Created end-to-end tests for multi-tenant isolation and real service interactions. - Added scripts for starting, stopping, and cleaning the development stack. - Enhanced API and tenant routes to support tenant-specific pipeline status initialization. - Updated constants for backend URL to reflect the correct port. - Improved error handling and logging in various components. * feat: Add multi-tenant support with enhanced E2E testing scripts and client functionality * update client * Add integration and unit tests for multi-tenant API, models, security, and storage - Implement integration tests for tenant and knowledge base management endpoints in `test_tenant_api_routes.py`. - Create unit tests for tenant isolation, model validation, and role permissions in `test_tenant_models.py`. - Add security tests to enforce role-based permissions and context validation in `test_tenant_security.py`. - Develop tests for tenant-aware storage operations and context isolation in `test_tenant_storage_phase3.py`. * feat(e2e): Implement OpenAI model support and database reset functionality * Add comprehensive test suite for gpt-5-nano compatibility - Introduced tests for parameter normalization, embeddings, and entity extraction. - Implemented direct API testing for gpt-5-nano. - Validated .env configuration loading and OpenAI API connectivity. - Analyzed reasoning token overhead with various token limits. - Documented test procedures and expected outcomes in README files. - Ensured all tests pass for production readiness. * kg(postgres_impl): ensure AGE extension is loaded in session and configure graph initialization * dev: add hybrid dev helper scripts, Makefile, docker-compose.dev-db and local development docs * feat(dev): add dev helper scripts and local development documentation for hybrid setup * feat(multi-tenant): add detailed specifications and logs for multi-tenant improvements, including UX, backend handling, and ingestion pipeline * feat(migration): add generated tenant/kb columns, indexes, triggers; drop unused tables; update schema and docs * test(backward-compat): adapt tests to new StorageNameSpace/TenantService APIs (use concrete dummy storages) * chore: multi-tenant and UX updates — docs, webui, storage, tenant service adjustments * tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency - gpt5_nano_compatibility: add pytest-asyncio markers, skip when OPENAI key missing, prevent module-level asyncio.run collection, add conftest - Ollama tests: add server availability check and skip markers; avoid pytest collection warnings by renaming helper classes - Graph storage tests: rename interactive test functions to avoid pytest collection - Document & Tenant routes: support external_ids for idempotency; ensure HTTPExceptions are re-raised - LightRAG core: support external_ids in apipeline_enqueue_documents and idempotent logic - Tests updated to match API changes (tenant routes & document routes) - Add logs and scripts for inspection and audit
64 lines
No EOL
33 KiB
JSON
64 lines
No EOL
33 KiB
JSON
{
|
|
"default:extract:ccf6dc292057df4be838f1f05b2e68bd": {
|
|
"return": "entity<|#|>Alice Johnson<|#|>person<|#|>Alice Johnson is a Data Scientist who works on machine learning projects.\nentity<|#|>Bob Smith<|#|>person<|#|>Bob Smith is a Software Architect who collaborates with Alice Johnson on projects.\nentity<|#|>TechCorp<|#|>organization<|#|>TechCorp is a company located in Seattle that specializes in AI solutions.\nentity<|#|>Seattle<|#|>location<|#|>Seattle is the city where TechCorp is located.\nrelation<|#|>Alice Johnson<|#|>TechCorp<|#|>employment, role<|#|>Alice Johnson works as a Data Scientist at TechCorp.\nrelation<|#|>Bob Smith<|#|>TechCorp<|#|>employment, role<|#|>Bob Smith works as a Software Architect at TechCorp.\nrelation<|#|>Alice Johnson<|#|>Bob Smith<|#|>collaboration, project<|#|>Alice Johnson collaborates with Bob Smith on machine learning projects.\nrelation<|#|>TechCorp<|#|>Seattle<|#|>location, organization<|#|>TechCorp is located in Seattle.\n<|COMPLETE|>",
|
|
"cache_type": "extract",
|
|
"chunk_id": "chunk-aa817c0beac97b28c7c333fc98e4ab4d",
|
|
"original_prompt": "---Task---\nExtract entities and relationships from the input text to be processed.\n\n---Instructions---\n1. **Strict Adherence to Format:** Strictly adhere to all format requirements for entity and relationship lists, including output order, field delimiters, and proper noun handling, as specified in the system prompt.\n2. **Output Content Only:** Output *only* the extracted list of entities and relationships. Do not include any introductory or concluding remarks, explanations, or additional text before or after the list.\n3. **Completion Signal:** Output `<|COMPLETE|>` as the final line after all relevant entities and relationships have been extracted and presented.\n4. **Output Language:** Ensure the output language is English. Proper nouns (e.g., personal names, place names, organization names) must be kept in their original language and not translated.\n\n<Output>\n---Role---\nYou are a Knowledge Graph Specialist responsible for extracting entities and relationships from the input text.\n\n---Instructions---\n1. **Entity Extraction & Output:**\n * **Identification:** Identify clearly defined and meaningful entities in the input text.\n * **Entity Details:** For each identified entity, extract the following information:\n * `entity_name`: The name of the entity. If the entity name is case-insensitive, capitalize the first letter of each significant word (title case). Ensure **consistent naming** across the entire extraction process.\n * `entity_type`: Categorize the entity using one of the following types: `Person,Creature,Organization,Location,Event,Concept,Method,Content,Data,Artifact,NaturalObject`. If none of the provided entity types apply, do not add new entity type and classify it as `Other`.\n * `entity_description`: Provide a concise yet comprehensive description of the entity's attributes and activities, based *solely* on the information present in the input text.\n * **Output Format - Entities:** Output a total of 4 fields for each entity, delimited by `<|#|>`, on a single line. The first field *must* be the literal string `entity`.\n * Format: `entity<|#|>entity_name<|#|>entity_type<|#|>entity_description`\n\n2. **Relationship Extraction & Output:**\n * **Identification:** Identify direct, clearly stated, and meaningful relationships between previously extracted entities.\n * **N-ary Relationship Decomposition:** If a single statement describes a relationship involving more than two entities (an N-ary relationship), decompose it into multiple binary (two-entity) relationship pairs for separate description.\n * **Example:** For \"Alice, Bob, and Carol collaborated on Project X,\" extract binary relationships such as \"Alice collaborated with Project X,\" \"Bob collaborated with Project X,\" and \"Carol collaborated with Project X,\" or \"Alice collaborated with Bob,\" based on the most reasonable binary interpretations.\n * **Relationship Details:** For each binary relationship, extract the following fields:\n * `source_entity`: The name of the source entity. Ensure **consistent naming** with entity extraction. Capitalize the first letter of each significant word (title case) if the name is case-insensitive.\n * `target_entity`: The name of the target entity. Ensure **consistent naming** with entity extraction. Capitalize the first letter of each significant word (title case) if the name is case-insensitive.\n * `relationship_keywords`: One or more high-level keywords summarizing the overarching nature, concepts, or themes of the relationship. Multiple keywords within this field must be separated by a comma `,`. **DO NOT use `<|#|>` for separating multiple keywords within this field.**\n * `relationship_description`: A concise explanation of the nature of the relationship between the source and target entities, providing a clear rationale for their connection.\n * **Output Format - Relationships:** Output a total of 5 fields for each relationship, delimited by `<|#|>`, on a single line. The first field *must* be the literal string `relation`.\n * Format: `relation<|#|>source_entity<|#|>target_entity<|#|>relationship_keywords<|#|>relationship_description`\n\n3. **Delimiter Usage Protocol:**\n * The `<|#|>` is a complete, atomic marker and **must not be filled with content**. It serves strictly as a field separator.\n * **Incorrect Example:** `entity<|#|>Tokyo<|location|>Tokyo is the capital of Japan.`\n * **Correct Example:** `entity<|#|>Tokyo<|#|>location<|#|>Tokyo is the capital of Japan.`\n\n4. **Relationship Direction & Duplication:**\n * Treat all relationships as **undirected** unless explicitly stated otherwise. Swapping the source and target entities for an undirected relationship does not constitute a new relationship.\n * Avoid outputting duplicate relationships.\n\n5. **Output Order & Prioritization:**\n * Output all extracted entities first, followed by all extracted relationships.\n * Within the list of relationships, prioritize and output those relationships that are **most significant** to the core meaning of the input text first.\n\n6. **Context & Objectivity:**\n * Ensure all entity names and descriptions are written in the **third person**.\n * Explicitly name the subject or object; **avoid using pronouns** such as `this article`, `this paper`, `our company`, `I`, `you`, and `he/she`.\n\n7. **Language & Proper Nouns:**\n * The entire output (entity names, keywords, and descriptions) must be written in `English`.\n * Proper nouns (e.g., personal names, place names, organization names) should be retained in their original language if a proper, widely accepted translation is not available or would cause ambiguity.\n\n8. **Completion Signal:** Output the literal string `<|COMPLETE|>` only after all entities and relationships, following all criteria, have been completely extracted and outputted.\n\n---Examples---\n<Input Text>\n```\nwhile Alex clenched his jaw, the buzz of frustration dull against the backdrop of Taylor's authoritarian certainty. It was this competitive undercurrent that kept him alert, the sense that his and Jordan's shared commitment to discovery was an unspoken rebellion against Cruz's narrowing vision of control and order.\n\nThen Taylor did something unexpected. They paused beside Jordan and, for a moment, observed the device with something akin to reverence. \"If this tech can be understood...\" Taylor said, their voice quieter, \"It could change the game for us. For all of us.\"\n\nThe underlying dismissal earlier seemed to falter, replaced by a glimpse of reluctant respect for the gravity of what lay in their hands. Jordan looked up, and for a fleeting heartbeat, their eyes locked with Taylor's, a wordless clash of wills softening into an uneasy truce.\n\nIt was a small transformation, barely perceptible, but one that Alex noted with an inward nod. They had all been brought here by different paths\n```\n\n<Output>\nentity<|#|>Alex<|#|>person<|#|>Alex is a character who experiences frustration and is observant of the dynamics among other characters.\nentity<|#|>Taylor<|#|>person<|#|>Taylor is portrayed with authoritarian certainty and shows a moment of reverence towards a device, indicating a change in perspective.\nentity<|#|>Jordan<|#|>person<|#|>Jordan shares a commitment to discovery and has a significant interaction with Taylor regarding a device.\nentity<|#|>Cruz<|#|>person<|#|>Cruz is associated with a vision of control and order, influencing the dynamics among other characters.\nentity<|#|>The Device<|#|>equiment<|#|>The Device is central to the story, with potential game-changing implications, and is revered by Taylor.\nrelation<|#|>Alex<|#|>Taylor<|#|>power dynamics, observation<|#|>Alex observes Taylor's authoritarian behavior and notes changes in Taylor's attitude toward the device.\nrelation<|#|>Alex<|#|>Jordan<|#|>shared goals, rebellion<|#|>Alex and Jordan share a commitment to discovery, which contrasts with Cruz's vision.)\nrelation<|#|>Taylor<|#|>Jordan<|#|>conflict resolution, mutual respect<|#|>Taylor and Jordan interact directly regarding the device, leading to a moment of mutual respect and an uneasy truce.\nrelation<|#|>Jordan<|#|>Cruz<|#|>ideological conflict, rebellion<|#|>Jordan's commitment to discovery is in rebellion against Cruz's vision of control and order.\nrelation<|#|>Taylor<|#|>The Device<|#|>reverence, technological significance<|#|>Taylor shows reverence towards the device, indicating its importance and potential impact.\n<|COMPLETE|>\n\n\n<Input Text>\n```\nStock markets faced a sharp downturn today as tech giants saw significant declines, with the global tech index dropping by 3.4% in midday trading. Analysts attribute the selloff to investor concerns over rising interest rates and regulatory uncertainty.\n\nAmong the hardest hit, nexon technologies saw its stock plummet by 7.8% after reporting lower-than-expected quarterly earnings. In contrast, Omega Energy posted a modest 2.1% gain, driven by rising oil prices.\n\nMeanwhile, commodity markets reflected a mixed sentiment. Gold futures rose by 1.5%, reaching $2,080 per ounce, as investors sought safe-haven assets. Crude oil prices continued their rally, climbing to $87.60 per barrel, supported by supply constraints and strong demand.\n\nFinancial experts are closely watching the Federal Reserve's next move, as speculation grows over potential rate hikes. The upcoming policy announcement is expected to influence investor confidence and overall market stability.\n```\n\n<Output>\nentity<|#|>Global Tech Index<|#|>category<|#|>The Global Tech Index tracks the performance of major technology stocks and experienced a 3.4% decline today.\nentity<|#|>Nexon Technologies<|#|>organization<|#|>Nexon Technologies is a tech company that saw its stock decline by 7.8% after disappointing earnings.\nentity<|#|>Omega Energy<|#|>organization<|#|>Omega Energy is an energy company that gained 2.1% in stock value due to rising oil prices.\nentity<|#|>Gold Futures<|#|>product<|#|>Gold futures rose by 1.5%, indicating increased investor interest in safe-haven assets.\nentity<|#|>Crude Oil<|#|>product<|#|>Crude oil prices rose to $87.60 per barrel due to supply constraints and strong demand.\nentity<|#|>Market Selloff<|#|>category<|#|>Market selloff refers to the significant decline in stock values due to investor concerns over interest rates and regulations.\nentity<|#|>Federal Reserve Policy Announcement<|#|>category<|#|>The Federal Reserve's upcoming policy announcement is expected to impact investor confidence and market stability.\nentity<|#|>3.4% Decline<|#|>category<|#|>The Global Tech Index experienced a 3.4% decline in midday trading.\nrelation<|#|>Global Tech Index<|#|>Market Selloff<|#|>market performance, investor sentiment<|#|>The decline in the Global Tech Index is part of the broader market selloff driven by investor concerns.\nrelation<|#|>Nexon Technologies<|#|>Global Tech Index<|#|>company impact, index movement<|#|>Nexon Technologies' stock decline contributed to the overall drop in the Global Tech Index.\nrelation<|#|>Gold Futures<|#|>Market Selloff<|#|>market reaction, safe-haven investment<|#|>Gold prices rose as investors sought safe-haven assets during the market selloff.\nrelation<|#|>Federal Reserve Policy Announcement<|#|>Market Selloff<|#|>interest rate impact, financial regulation<|#|>Speculation over Federal Reserve policy changes contributed to market volatility and investor selloff.\n<|COMPLETE|>\n\n\n<Input Text>\n```\nAt the World Athletics Championship in Tokyo, Noah Carter broke the 100m sprint record using cutting-edge carbon-fiber spikes.\n```\n\n<Output>\nentity<|#|>World Athletics Championship<|#|>event<|#|>The World Athletics Championship is a global sports competition featuring top athletes in track and field.\nentity<|#|>Tokyo<|#|>location<|#|>Tokyo is the host city of the World Athletics Championship.\nentity<|#|>Noah Carter<|#|>person<|#|>Noah Carter is a sprinter who set a new record in the 100m sprint at the World Athletics Championship.\nentity<|#|>100m Sprint Record<|#|>category<|#|>The 100m sprint record is a benchmark in athletics, recently broken by Noah Carter.\nentity<|#|>Carbon-Fiber Spikes<|#|>equipment<|#|>Carbon-fiber spikes are advanced sprinting shoes that provide enhanced speed and traction.\nentity<|#|>World Athletics Federation<|#|>organization<|#|>The World Athletics Federation is the governing body overseeing the World Athletics Championship and record validations.\nrelation<|#|>World Athletics Championship<|#|>Tokyo<|#|>event location, international competition<|#|>The World Athletics Championship is being hosted in Tokyo.\nrelation<|#|>Noah Carter<|#|>100m Sprint Record<|#|>athlete achievement, record-breaking<|#|>Noah Carter set a new 100m sprint record at the championship.\nrelation<|#|>Noah Carter<|#|>Carbon-Fiber Spikes<|#|>athletic equipment, performance boost<|#|>Noah Carter used carbon-fiber spikes to enhance performance during the race.\nrelation<|#|>Noah Carter<|#|>World Athletics Championship<|#|>athlete participation, competition<|#|>Noah Carter is competing at the World Athletics Championship.\n<|COMPLETE|>\n\n\n\n---Real Data to be Processed---\n<Input>\nEntity_types: [Person,Creature,Organization,Location,Event,Concept,Method,Content,Data,Artifact,NaturalObject]\nText:\n```\nAlice Johnson is a Data Scientist at TechCorp.\n She works on machine learning projects with Bob Smith, who is a Software Architect.\n TechCorp is located in Seattle and specializes in AI solutions.\n```",
|
|
"queryparam": null,
|
|
"create_time": 1764687047,
|
|
"update_time": 1764687047,
|
|
"_id": "default:extract:ccf6dc292057df4be838f1f05b2e68bd"
|
|
},
|
|
"default:extract:eb816734e0590cbf772fd59409d12420": {
|
|
"return": "<|COMPLETE|>",
|
|
"cache_type": "extract",
|
|
"chunk_id": "chunk-aa817c0beac97b28c7c333fc98e4ab4d",
|
|
"original_prompt": "---Task---\nBased on the last extraction task, identify and extract any **missed or incorrectly formatted** entities and relationships from the input text.\n\n---Instructions---\n1. **Strict Adherence to System Format:** Strictly adhere to all format requirements for entity and relationship lists, including output order, field delimiters, and proper noun handling, as specified in the system instructions.\n2. **Focus on Corrections/Additions:**\n * **Do NOT** re-output entities and relationships that were **correctly and fully** extracted in the last task.\n * If an entity or relationship was **missed** in the last task, extract and output it now according to the system format.\n * If an entity or relationship was **truncated, had missing fields, or was otherwise incorrectly formatted** in the last task, re-output the *corrected and complete* version in the specified format.\n3. **Output Format - Entities:** Output a total of 4 fields for each entity, delimited by `<|#|>`, on a single line. The first field *must* be the literal string `entity`.\n4. **Output Format - Relationships:** Output a total of 5 fields for each relationship, delimited by `<|#|>`, on a single line. The first field *must* be the literal string `relation`.\n5. **Output Content Only:** Output *only* the extracted list of entities and relationships. Do not include any introductory or concluding remarks, explanations, or additional text before or after the list.\n6. **Completion Signal:** Output `<|COMPLETE|>` as the final line after all relevant missing or corrected entities and relationships have been extracted and presented.\n7. **Output Language:** Ensure the output language is English. Proper nouns (e.g., personal names, place names, organization names) must be kept in their original language and not translated.\n\n<Output>\n---Role---\nYou are a Knowledge Graph Specialist responsible for extracting entities and relationships from the input text.\n\n---Instructions---\n1. **Entity Extraction & Output:**\n * **Identification:** Identify clearly defined and meaningful entities in the input text.\n * **Entity Details:** For each identified entity, extract the following information:\n * `entity_name`: The name of the entity. If the entity name is case-insensitive, capitalize the first letter of each significant word (title case). Ensure **consistent naming** across the entire extraction process.\n * `entity_type`: Categorize the entity using one of the following types: `Person,Creature,Organization,Location,Event,Concept,Method,Content,Data,Artifact,NaturalObject`. If none of the provided entity types apply, do not add new entity type and classify it as `Other`.\n * `entity_description`: Provide a concise yet comprehensive description of the entity's attributes and activities, based *solely* on the information present in the input text.\n * **Output Format - Entities:** Output a total of 4 fields for each entity, delimited by `<|#|>`, on a single line. The first field *must* be the literal string `entity`.\n * Format: `entity<|#|>entity_name<|#|>entity_type<|#|>entity_description`\n\n2. **Relationship Extraction & Output:**\n * **Identification:** Identify direct, clearly stated, and meaningful relationships between previously extracted entities.\n * **N-ary Relationship Decomposition:** If a single statement describes a relationship involving more than two entities (an N-ary relationship), decompose it into multiple binary (two-entity) relationship pairs for separate description.\n * **Example:** For \"Alice, Bob, and Carol collaborated on Project X,\" extract binary relationships such as \"Alice collaborated with Project X,\" \"Bob collaborated with Project X,\" and \"Carol collaborated with Project X,\" or \"Alice collaborated with Bob,\" based on the most reasonable binary interpretations.\n * **Relationship Details:** For each binary relationship, extract the following fields:\n * `source_entity`: The name of the source entity. Ensure **consistent naming** with entity extraction. Capitalize the first letter of each significant word (title case) if the name is case-insensitive.\n * `target_entity`: The name of the target entity. Ensure **consistent naming** with entity extraction. Capitalize the first letter of each significant word (title case) if the name is case-insensitive.\n * `relationship_keywords`: One or more high-level keywords summarizing the overarching nature, concepts, or themes of the relationship. Multiple keywords within this field must be separated by a comma `,`. **DO NOT use `<|#|>` for separating multiple keywords within this field.**\n * `relationship_description`: A concise explanation of the nature of the relationship between the source and target entities, providing a clear rationale for their connection.\n * **Output Format - Relationships:** Output a total of 5 fields for each relationship, delimited by `<|#|>`, on a single line. The first field *must* be the literal string `relation`.\n * Format: `relation<|#|>source_entity<|#|>target_entity<|#|>relationship_keywords<|#|>relationship_description`\n\n3. **Delimiter Usage Protocol:**\n * The `<|#|>` is a complete, atomic marker and **must not be filled with content**. It serves strictly as a field separator.\n * **Incorrect Example:** `entity<|#|>Tokyo<|location|>Tokyo is the capital of Japan.`\n * **Correct Example:** `entity<|#|>Tokyo<|#|>location<|#|>Tokyo is the capital of Japan.`\n\n4. **Relationship Direction & Duplication:**\n * Treat all relationships as **undirected** unless explicitly stated otherwise. Swapping the source and target entities for an undirected relationship does not constitute a new relationship.\n * Avoid outputting duplicate relationships.\n\n5. **Output Order & Prioritization:**\n * Output all extracted entities first, followed by all extracted relationships.\n * Within the list of relationships, prioritize and output those relationships that are **most significant** to the core meaning of the input text first.\n\n6. **Context & Objectivity:**\n * Ensure all entity names and descriptions are written in the **third person**.\n * Explicitly name the subject or object; **avoid using pronouns** such as `this article`, `this paper`, `our company`, `I`, `you`, and `he/she`.\n\n7. **Language & Proper Nouns:**\n * The entire output (entity names, keywords, and descriptions) must be written in `English`.\n * Proper nouns (e.g., personal names, place names, organization names) should be retained in their original language if a proper, widely accepted translation is not available or would cause ambiguity.\n\n8. **Completion Signal:** Output the literal string `<|COMPLETE|>` only after all entities and relationships, following all criteria, have been completely extracted and outputted.\n\n---Examples---\n<Input Text>\n```\nwhile Alex clenched his jaw, the buzz of frustration dull against the backdrop of Taylor's authoritarian certainty. It was this competitive undercurrent that kept him alert, the sense that his and Jordan's shared commitment to discovery was an unspoken rebellion against Cruz's narrowing vision of control and order.\n\nThen Taylor did something unexpected. They paused beside Jordan and, for a moment, observed the device with something akin to reverence. \"If this tech can be understood...\" Taylor said, their voice quieter, \"It could change the game for us. For all of us.\"\n\nThe underlying dismissal earlier seemed to falter, replaced by a glimpse of reluctant respect for the gravity of what lay in their hands. Jordan looked up, and for a fleeting heartbeat, their eyes locked with Taylor's, a wordless clash of wills softening into an uneasy truce.\n\nIt was a small transformation, barely perceptible, but one that Alex noted with an inward nod. They had all been brought here by different paths\n```\n\n<Output>\nentity<|#|>Alex<|#|>person<|#|>Alex is a character who experiences frustration and is observant of the dynamics among other characters.\nentity<|#|>Taylor<|#|>person<|#|>Taylor is portrayed with authoritarian certainty and shows a moment of reverence towards a device, indicating a change in perspective.\nentity<|#|>Jordan<|#|>person<|#|>Jordan shares a commitment to discovery and has a significant interaction with Taylor regarding a device.\nentity<|#|>Cruz<|#|>person<|#|>Cruz is associated with a vision of control and order, influencing the dynamics among other characters.\nentity<|#|>The Device<|#|>equiment<|#|>The Device is central to the story, with potential game-changing implications, and is revered by Taylor.\nrelation<|#|>Alex<|#|>Taylor<|#|>power dynamics, observation<|#|>Alex observes Taylor's authoritarian behavior and notes changes in Taylor's attitude toward the device.\nrelation<|#|>Alex<|#|>Jordan<|#|>shared goals, rebellion<|#|>Alex and Jordan share a commitment to discovery, which contrasts with Cruz's vision.)\nrelation<|#|>Taylor<|#|>Jordan<|#|>conflict resolution, mutual respect<|#|>Taylor and Jordan interact directly regarding the device, leading to a moment of mutual respect and an uneasy truce.\nrelation<|#|>Jordan<|#|>Cruz<|#|>ideological conflict, rebellion<|#|>Jordan's commitment to discovery is in rebellion against Cruz's vision of control and order.\nrelation<|#|>Taylor<|#|>The Device<|#|>reverence, technological significance<|#|>Taylor shows reverence towards the device, indicating its importance and potential impact.\n<|COMPLETE|>\n\n\n<Input Text>\n```\nStock markets faced a sharp downturn today as tech giants saw significant declines, with the global tech index dropping by 3.4% in midday trading. Analysts attribute the selloff to investor concerns over rising interest rates and regulatory uncertainty.\n\nAmong the hardest hit, nexon technologies saw its stock plummet by 7.8% after reporting lower-than-expected quarterly earnings. In contrast, Omega Energy posted a modest 2.1% gain, driven by rising oil prices.\n\nMeanwhile, commodity markets reflected a mixed sentiment. Gold futures rose by 1.5%, reaching $2,080 per ounce, as investors sought safe-haven assets. Crude oil prices continued their rally, climbing to $87.60 per barrel, supported by supply constraints and strong demand.\n\nFinancial experts are closely watching the Federal Reserve's next move, as speculation grows over potential rate hikes. The upcoming policy announcement is expected to influence investor confidence and overall market stability.\n```\n\n<Output>\nentity<|#|>Global Tech Index<|#|>category<|#|>The Global Tech Index tracks the performance of major technology stocks and experienced a 3.4% decline today.\nentity<|#|>Nexon Technologies<|#|>organization<|#|>Nexon Technologies is a tech company that saw its stock decline by 7.8% after disappointing earnings.\nentity<|#|>Omega Energy<|#|>organization<|#|>Omega Energy is an energy company that gained 2.1% in stock value due to rising oil prices.\nentity<|#|>Gold Futures<|#|>product<|#|>Gold futures rose by 1.5%, indicating increased investor interest in safe-haven assets.\nentity<|#|>Crude Oil<|#|>product<|#|>Crude oil prices rose to $87.60 per barrel due to supply constraints and strong demand.\nentity<|#|>Market Selloff<|#|>category<|#|>Market selloff refers to the significant decline in stock values due to investor concerns over interest rates and regulations.\nentity<|#|>Federal Reserve Policy Announcement<|#|>category<|#|>The Federal Reserve's upcoming policy announcement is expected to impact investor confidence and market stability.\nentity<|#|>3.4% Decline<|#|>category<|#|>The Global Tech Index experienced a 3.4% decline in midday trading.\nrelation<|#|>Global Tech Index<|#|>Market Selloff<|#|>market performance, investor sentiment<|#|>The decline in the Global Tech Index is part of the broader market selloff driven by investor concerns.\nrelation<|#|>Nexon Technologies<|#|>Global Tech Index<|#|>company impact, index movement<|#|>Nexon Technologies' stock decline contributed to the overall drop in the Global Tech Index.\nrelation<|#|>Gold Futures<|#|>Market Selloff<|#|>market reaction, safe-haven investment<|#|>Gold prices rose as investors sought safe-haven assets during the market selloff.\nrelation<|#|>Federal Reserve Policy Announcement<|#|>Market Selloff<|#|>interest rate impact, financial regulation<|#|>Speculation over Federal Reserve policy changes contributed to market volatility and investor selloff.\n<|COMPLETE|>\n\n\n<Input Text>\n```\nAt the World Athletics Championship in Tokyo, Noah Carter broke the 100m sprint record using cutting-edge carbon-fiber spikes.\n```\n\n<Output>\nentity<|#|>World Athletics Championship<|#|>event<|#|>The World Athletics Championship is a global sports competition featuring top athletes in track and field.\nentity<|#|>Tokyo<|#|>location<|#|>Tokyo is the host city of the World Athletics Championship.\nentity<|#|>Noah Carter<|#|>person<|#|>Noah Carter is a sprinter who set a new record in the 100m sprint at the World Athletics Championship.\nentity<|#|>100m Sprint Record<|#|>category<|#|>The 100m sprint record is a benchmark in athletics, recently broken by Noah Carter.\nentity<|#|>Carbon-Fiber Spikes<|#|>equipment<|#|>Carbon-fiber spikes are advanced sprinting shoes that provide enhanced speed and traction.\nentity<|#|>World Athletics Federation<|#|>organization<|#|>The World Athletics Federation is the governing body overseeing the World Athletics Championship and record validations.\nrelation<|#|>World Athletics Championship<|#|>Tokyo<|#|>event location, international competition<|#|>The World Athletics Championship is being hosted in Tokyo.\nrelation<|#|>Noah Carter<|#|>100m Sprint Record<|#|>athlete achievement, record-breaking<|#|>Noah Carter set a new 100m sprint record at the championship.\nrelation<|#|>Noah Carter<|#|>Carbon-Fiber Spikes<|#|>athletic equipment, performance boost<|#|>Noah Carter used carbon-fiber spikes to enhance performance during the race.\nrelation<|#|>Noah Carter<|#|>World Athletics Championship<|#|>athlete participation, competition<|#|>Noah Carter is competing at the World Athletics Championship.\n<|COMPLETE|>\n\n\n\n---Real Data to be Processed---\n<Input>\nEntity_types: [Person,Creature,Organization,Location,Event,Concept,Method,Content,Data,Artifact,NaturalObject]\nText:\n```\nAlice Johnson is a Data Scientist at TechCorp.\n She works on machine learning projects with Bob Smith, who is a Software Architect.\n TechCorp is located in Seattle and specializes in AI solutions.\n```\n[{\"role\": \"user\", \"content\": \"---Task---\\nExtract entities and relationships from the input text to be processed.\\n\\n---Instructions---\\n1. **Strict Adherence to Format:** Strictly adhere to all format requirements for entity and relationship lists, including output order, field delimiters, and proper noun handling, as specified in the system prompt.\\n2. **Output Content Only:** Output *only* the extracted list of entities and relationships. Do not include any introductory or concluding remarks, explanations, or additional text before or after the list.\\n3. **Completion Signal:** Output `<|COMPLETE|>` as the final line after all relevant entities and relationships have been extracted and presented.\\n4. **Output Language:** Ensure the output language is English. Proper nouns (e.g., personal names, place names, organization names) must be kept in their original language and not translated.\\n\\n<Output>\"}, {\"role\": \"assistant\", \"content\": \"entity<|#|>Alice Johnson<|#|>person<|#|>Alice Johnson is a Data Scientist who works on machine learning projects.\\nentity<|#|>Bob Smith<|#|>person<|#|>Bob Smith is a Software Architect who collaborates with Alice Johnson on projects.\\nentity<|#|>TechCorp<|#|>organization<|#|>TechCorp is a company located in Seattle that specializes in AI solutions.\\nentity<|#|>Seattle<|#|>location<|#|>Seattle is the city where TechCorp is located.\\nrelation<|#|>Alice Johnson<|#|>TechCorp<|#|>employment, role<|#|>Alice Johnson works as a Data Scientist at TechCorp.\\nrelation<|#|>Bob Smith<|#|>TechCorp<|#|>employment, role<|#|>Bob Smith works as a Software Architect at TechCorp.\\nrelation<|#|>Alice Johnson<|#|>Bob Smith<|#|>collaboration, project<|#|>Alice Johnson collaborates with Bob Smith on machine learning projects.\\nrelation<|#|>TechCorp<|#|>Seattle<|#|>location, organization<|#|>TechCorp is located in Seattle.\\n<|COMPLETE|>\"}]",
|
|
"queryparam": null,
|
|
"create_time": 1764687050,
|
|
"update_time": 1764687050,
|
|
"_id": "default:extract:eb816734e0590cbf772fd59409d12420"
|
|
},
|
|
"hybrid:keywords:a165afdf6db345b29ff420fcbd9da232": {
|
|
"return": "{\"high_level_keywords\": [\"TechCorp\", \"Employee roles\", \"Workplace\"], \"low_level_keywords\": [\"Job titles\", \"Departments\", \"Responsibilities\", \"Company culture\"]}",
|
|
"cache_type": "keywords",
|
|
"chunk_id": null,
|
|
"original_prompt": "Who works at TechCorp and what do they do?",
|
|
"queryparam": {
|
|
"mode": "hybrid",
|
|
"response_type": "Multiple Paragraphs",
|
|
"top_k": 40,
|
|
"chunk_top_k": 20,
|
|
"max_entity_tokens": 6000,
|
|
"max_relation_tokens": 8000,
|
|
"max_total_tokens": 30000,
|
|
"user_prompt": "",
|
|
"enable_rerank": true
|
|
},
|
|
"create_time": 1764687062,
|
|
"update_time": 1764687062,
|
|
"_id": "hybrid:keywords:a165afdf6db345b29ff420fcbd9da232"
|
|
},
|
|
"hybrid:query:5e9da9e3fbf0cf11eb598973654c3112": {
|
|
"return": "At TechCorp, there are two key individuals mentioned:\n\n1. **Alice Johnson**: She works as a Data Scientist and is involved in machine learning projects. She collaborates with others on these projects, particularly with Bob Smith.\n\n2. **Bob Smith**: He serves as a Software Architect at TechCorp. He works alongside Alice Johnson on their machine learning initiatives.\n\nTechCorp, known for specializing in AI solutions, is located in Seattle.\n\n### References\n* [1] Document Title One",
|
|
"cache_type": "query",
|
|
"chunk_id": null,
|
|
"original_prompt": "Who works at TechCorp and what do they do?",
|
|
"queryparam": {
|
|
"mode": "hybrid",
|
|
"response_type": "Multiple Paragraphs",
|
|
"top_k": 40,
|
|
"chunk_top_k": 20,
|
|
"max_entity_tokens": 6000,
|
|
"max_relation_tokens": 8000,
|
|
"max_total_tokens": 30000,
|
|
"hl_keywords": "TechCorp, Employee roles, Workplace",
|
|
"ll_keywords": "Job titles, Departments, Responsibilities, Company culture",
|
|
"user_prompt": "",
|
|
"enable_rerank": true
|
|
},
|
|
"create_time": 1764687069,
|
|
"update_time": 1764687069,
|
|
"_id": "hybrid:query:5e9da9e3fbf0cf11eb598973654c3112"
|
|
}
|
|
} |