Update to enable knowledge extraction using the agent framework (#439)

* Implement KG extraction agent (kg-extract-agent)

* Using ReAct framework (agent-manager-react)
 
* ReAct manager had an issue when emitting JSON, which conflicts which ReAct manager's own JSON messages, so refactored ReAct manager to use traditional ReAct messages, non-JSON structure.
 
* Minor refactor to take the prompt template client out of prompt-template so it can be more readily used by other modules. kg-extract-agent uses this framework.
This commit is contained in:
cybermaggedon 2025-07-21 14:31:57 +01:00 committed by GitHub
parent 1fe4ed5226
commit d83e4e3d59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 3192 additions and 799 deletions

View file

@ -6,6 +6,10 @@ import json
import re
import sys
import functools
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
from ... base import AgentService, TextCompletionClientSpec, PromptClientSpec
from ... base import GraphRagClientSpec, ToolClientSpec
@ -221,6 +225,11 @@ class Processor(AgentService):
print("Send final response...", flush=True)
if isinstance(act.final, str):
f = act.final
else:
f = json.dumps(act.final)
r = AgentResponse(
answer=act.final,
error=None,
@ -292,6 +301,5 @@ class Processor(AgentService):
)
def run():
Processor.launch(default_ident, __doc__)