Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/valuecell/agents/research_agent/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
KNOWLEDGE_AGENT_EXPECTED_OUTPUT,
KNOWLEDGE_AGENT_INSTRUCTION,
)
from valuecell.agents.research_agent.sources import (
from valuecell.agents.research_agent.sources import ( # search_crypto_people,; search_crypto_projects,; search_crypto_vcs,
fetch_ashare_filings,
fetch_event_sec_filings,
fetch_periodic_sec_filings,
Expand All @@ -32,6 +32,10 @@ def __init__(self, **kwargs):
fetch_event_sec_filings,
fetch_ashare_filings,
web_search,
# TODO: The RootData tools will cost lots of time, so we disable them for now.
# search_crypto_projects,
# search_crypto_vcs,
# search_crypto_people,
]
self.knowledge_research_agent = Agent(
model=model_utils_mod.get_model_for_agent("research_agent"),
Expand Down
133 changes: 132 additions & 1 deletion python/valuecell/agents/research_agent/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@
from agno.agent import Agent
from edgar import Company
from edgar.entity.filings import EntityFilings

from loguru import logger

from valuecell.agents.sources import (
get_person_detail,
get_project_detail,
get_vc_detail,
search_people,
search_projects,
search_vcs,
)
from valuecell.utils.path import get_knowledge_path

from .knowledge import insert_md_file_to_knowledge, insert_pdf_file_to_knowledge
Expand Down Expand Up @@ -690,3 +699,125 @@ async def fetch_ashare_filings(
# Write to files and import to knowledge base
knowledge_dir = Path(get_knowledge_path())
return await _write_and_ingest_ashare(filings_data, knowledge_dir)


# ============================================================================
# Crypto Project Data Tools (RootData)
# ============================================================================


async def search_crypto_projects(
query: str,
limit: int = 10,
) -> str:
"""Search cryptocurrency projects on RootData by keyword.

Use this tool when users ask about cryptocurrency projects, tokens, or blockchain ecosystems.
Examples: "What is Ethereum?", "Tell me about DeFi projects", "Find projects related to AI"

Args:
query: Search keyword (project name, token symbol, or category like "DeFi", "AI", "GameFi")
limit: Maximum number of results to return (default: 5, max recommended: 10)

Returns:
JSON string with project information including name, description, tags, and key metrics.
"""

logger.info(f"Searching crypto projects for: {query}")

try:
projects = await search_projects(query, limit=limit, use_playwright=True)

if not projects:
return f"No cryptocurrency projects found for query: {query}"

logger.debug(f"Search crypto projects get {len(projects)} results.")

for i, proj in enumerate(projects, 1):
proj = await get_project_detail(proj.id)
if not proj:
logger.warning(f"No project found with ID: {proj.id}")
continue
return proj.model_dump_json(exclude_none=True)

except Exception as e:
logger.error(f"Error searching crypto projects: {e}")
return f"Error searching cryptocurrency projects: {str(e)}"


async def search_crypto_vcs(
query: str,
limit: int = 5,
) -> str:
"""Search venture capital firms and crypto investors on RootData.

Use this tool when users ask about VCs, investment firms, or crypto investors.
Examples: "Who invested in Ethereum?", "Find VCs focused on DeFi", "Tell me about a16z crypto"

Args:
query: Search keyword (VC name, investment focus, or category)
limit: Maximum number of results to return (default: 5, max recommended: 10)

Returns:
Formatted string with VC information including name, description, portfolio, and links.
"""

logger.info(f"Searching crypto VCs for: {query}")

try:
vcs = await search_vcs(query, limit=limit, use_playwright=True)

if not vcs:
return f"No venture capital firms found for query: {query}"

logger.debug(f"Search crypto VCs get {len(vcs)} results.")

for i, vc in enumerate(vcs, 1):
vc = await get_vc_detail(vc.id)
if not vc:
logger.warning(f"No VC found with ID: {vc.id}")
continue
return vc.model_dump_json()

except Exception as e:
logger.error(f"Error searching crypto VCs: {e}")
return f"Error searching venture capital firms: {str(e)}"


async def search_crypto_people(
query: str,
limit: int = 5,
) -> str:
"""Search crypto industry people on RootData (founders, executives, investors).

Use this tool when users ask about people in crypto, founders, or industry leaders.
Examples: "Who is Vitalik Buterin?", "Find founders of Ethereum", "Tell me about crypto investors"

Args:
query: Search keyword (person name, role, or organization)
limit: Maximum number of results to return (default: 5, max recommended: 10)

Returns:
Formatted string with person information including name, title, projects, and links.
"""

logger.info(f"Searching crypto people for: {query}")

try:
people = await search_people(query, limit=limit, use_playwright=True)

if not people:
return f"No people found for query: {query}"

logger.debug(f"Search crypto people get {len(people)} results.")

for i, person in enumerate(people, 1):
person = await get_person_detail(person.id)
if not person:
logger.warning(f"No person found with ID: {person.id}")
continue
return person.model_dump_json()

except Exception as e:
logger.error(f"Error searching crypto people: {e}")
return f"Error searching people: {str(e)}"
30 changes: 30 additions & 0 deletions python/valuecell/agents/sources/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
ValueCell agents data sources

Available sources:
- rootdata: Cryptocurrency projects, VCs and people data from RootData.com
"""

from valuecell.agents.sources.rootdata import (
RootDataPerson,
RootDataProject,
RootDataVC,
get_person_detail,
get_project_detail,
get_vc_detail,
search_people,
search_projects,
search_vcs,
)

__all__ = [
"RootDataProject",
"RootDataVC",
"RootDataPerson",
"get_project_detail",
"get_vc_detail",
"get_person_detail",
"search_projects",
"search_vcs",
"search_people",
]
Loading