Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- .gitignore +2 -0
- app.py +6 -3
- investigators/src/investigators/config/agents.yaml +1 -0
- investigators/src/investigators/crew.py +25 -0
.gitignore
CHANGED
@@ -177,3 +177,5 @@ cython_debug/
|
|
177 |
output/*
|
178 |
investigators/output/*
|
179 |
search_results_2025*
|
|
|
|
|
|
177 |
output/*
|
178 |
investigators/output/*
|
179 |
search_results_2025*
|
180 |
+
.DS_Store
|
181 |
+
memory/*
|
app.py
CHANGED
@@ -58,15 +58,18 @@ with gr.Blocks() as view:
|
|
58 |
outputs=output
|
59 |
)
|
60 |
|
61 |
-
|
62 |
-
|
63 |
clear_btn.click(
|
64 |
fn=clear_inputs,
|
65 |
inputs=[],
|
66 |
outputs=[name_input, affiliation_input]
|
67 |
)
|
68 |
gr.Examples(
|
69 |
-
examples=[["Raz Nissim", "Ben Gurion University, General Motors"]
|
|
|
|
|
|
|
|
|
|
|
70 |
inputs=[name_input, affiliation_input]
|
71 |
)
|
72 |
|
|
|
58 |
outputs=output
|
59 |
)
|
60 |
|
|
|
|
|
61 |
clear_btn.click(
|
62 |
fn=clear_inputs,
|
63 |
inputs=[],
|
64 |
outputs=[name_input, affiliation_input]
|
65 |
)
|
66 |
gr.Examples(
|
67 |
+
examples=[["Raz Nissim", "Ben Gurion University, General Motors"],
|
68 |
+
["Mohammed Mosharref Hossain", "Albany"],
|
69 |
+
["Giovanni Cazzetta", "Montreal"],
|
70 |
+
["Willy Bokonga", "Congo"],
|
71 |
+
["Avraham Hirshzon", "Israel, Politician"],
|
72 |
+
],
|
73 |
inputs=[name_input, affiliation_input]
|
74 |
)
|
75 |
|
investigators/src/investigators/config/agents.yaml
CHANGED
@@ -9,6 +9,7 @@ researcher:
|
|
9 |
finding and connecting information about people and businesses. You know how to
|
10 |
follow information trails and identify valuable data sources.
|
11 |
You have the ability to search the web using search tools.
|
|
|
12 |
llm: openai/gpt-4o
|
13 |
|
14 |
fincrime_analyst:
|
|
|
9 |
finding and connecting information about people and businesses. You know how to
|
10 |
follow information trails and identify valuable data sources.
|
11 |
You have the ability to search the web using search tools.
|
12 |
+
You have the ability to use your memory to gather information.
|
13 |
llm: openai/gpt-4o
|
14 |
|
15 |
fincrime_analyst:
|
investigators/src/investigators/crew.py
CHANGED
@@ -5,6 +5,11 @@ from crewai import TaskOutput
|
|
5 |
from crewai_tools import SerperDevTool
|
6 |
from crewai_tools import ScrapeWebsiteTool
|
7 |
from crewai_tools import BraveSearchTool
|
|
|
|
|
|
|
|
|
|
|
8 |
NO_INFORMATION_FOUND="no information found"
|
9 |
|
10 |
def validate_researcher_content(result: TaskOutput) -> Tuple[bool, Any]:
|
@@ -93,4 +98,24 @@ class Investigators():
|
|
93 |
tasks=self.tasks, # Automatically created by the @task decorator
|
94 |
process=Process.sequential,
|
95 |
verbose=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
)
|
|
|
5 |
from crewai_tools import SerperDevTool
|
6 |
from crewai_tools import ScrapeWebsiteTool
|
7 |
from crewai_tools import BraveSearchTool
|
8 |
+
|
9 |
+
from crewai.memory import LongTermMemory, EntityMemory
|
10 |
+
from crewai.memory.storage.rag_storage import RAGStorage
|
11 |
+
from crewai.memory.storage.ltm_sqlite_storage import LTMSQLiteStorage
|
12 |
+
|
13 |
NO_INFORMATION_FOUND="no information found"
|
14 |
|
15 |
def validate_researcher_content(result: TaskOutput) -> Tuple[bool, Any]:
|
|
|
98 |
tasks=self.tasks, # Automatically created by the @task decorator
|
99 |
process=Process.sequential,
|
100 |
verbose=True,
|
101 |
+
memory=True,
|
102 |
+
# Long-term memory for persistent storage across sessions
|
103 |
+
long_term_memory = LongTermMemory(
|
104 |
+
storage=LTMSQLiteStorage(
|
105 |
+
db_path="./memory/long_term_memory_storage.db"
|
106 |
+
)
|
107 |
+
),
|
108 |
+
# Entity memory for tracking key information about entities
|
109 |
+
entity_memory = EntityMemory(
|
110 |
+
storage=RAGStorage(
|
111 |
+
embedder_config={
|
112 |
+
"provider": "openai",
|
113 |
+
"config": {
|
114 |
+
"model": 'text-embedding-3-small'
|
115 |
+
}
|
116 |
+
},
|
117 |
+
type="short_term",
|
118 |
+
path="./memory/"
|
119 |
+
)
|
120 |
+
),
|
121 |
)
|