LinkedInKGAgent
What it is
A factory and thin agent wrapper that builds an IntentAgent specialized for querying LinkedIn data stored in a knowledge graph. It:
- Loads SPARQL query tools from the “templatable SPARQL query” module.
- Adds vector-search tools to resolve person/company URIs via semantic similarity.
- Returns an
IntentAgentinstance (LinkedInKGAgent) configured with a LinkedIn-focused system prompt and intents.
Public API
Constants
NAME:"LinkedIn_KG"DESCRIPTION: Human-readable agent description.AVATAR_URL: LinkedIn logo URL.SYSTEM_PROMPT: System instructions template. Tool list is injected at runtime.SUGGESTIONS: Empty list (list[str]).
Functions
create_agent(agent_shared_state: Optional[AgentSharedState] = None, agent_configuration: Optional[AgentConfiguration] = None) -> IntentAgent- Creates and returns a configured
LinkedInKGAgent. - Wires SPARQL tools and two vector-search tools:
linkedin_search_person_uri(collection:linkedin_persons)linkedin_search_company_uri(collection:linkedin_companies)
- Creates and returns a configured
Classes
class LinkedInKGAgent(IntentAgent)- No additional behavior; inherits everything from
IntentAgent.
- No additional behavior; inherits everything from
Configuration/Dependencies
This module relies on an existing Naas ABI runtime with modules/services available:
-
Naas ABI core
naas_abi_core.services.agent.IntentAgent(IntentAgent,AgentConfiguration,AgentSharedState,Intent,IntentType)naas_abi_core.modules.templatablesparqlquery.ABIModuleto provide SPARQL tools viaget_tools(...)naas_abi_core.services.vector_store.VectorStoreServicefor similarity search
-
Marketplace / Application
naas_abi_marketplace.applications.linkedin.ABIModule.get_instance().enginemust be initialized and contain:- module key:
"naas_abi_core.modules.templatablesparqlquery" - service:
engine.services.vector_store
- module key:
-
LLM / embeddings
- Chat model:
naas_abi_marketplace.ai.chatgpt.models.gpt_4_1_mini.model - Embeddings:
langchain_openai.OpenAIEmbeddings(model="text-embedding-3-large") - Requires
numpy,pydantic,langchain_core.tools.StructuredTool
- Chat model:
Usage
from naas_abi_marketplace.applications.linkedin.agents.LinkedInKGAgent import create_agent
from naas_abi_core.services.agent.IntentAgent import AgentSharedState
agent = create_agent(agent_shared_state=AgentSharedState(thread_id="demo"))
# How you invoke/run the agent depends on IntentAgent's interface in naas_abi_core.
# This module only constructs and returns the configured agent instance.
print(agent.name)
Caveats
- The factory assumes the LinkedIn
ABIModuleengine is already initialized and contains the required module/service; otherwise tool wiring will fail (including anasserton the SPARQL module type). - Two intents reference tool names not defined in the tool list built here (e.g.,
linkedin_search_connections_by_person_name,linkedin_get_connection_information,linkedin_search_email_address_by_person_uri). Successful execution depends on those tools existing in the broader runtime/tool registry. - Vector search tools require populated vector store collections named:
linkedin_personslinkedin_companies