Are There Configuration Files in TrendRadar's Root? A Complete Guide to the `config/` Directory

Yes, all user-editable configuration files in TrendRadar are stored in the config/ directory at the repository root, with config/config.yaml serving as the central configuration entry point.

TrendRadar, an open-source trend monitoring and analysis tool, follows a clear separation between code and configuration. Rather than scattering settings throughout the codebase, the project centralizes all operational parameters in a dedicated config/ folder. This design makes the tool more maintainable and easier to deploy across different environments.

The Main Configuration File: config/config.yaml

The heart of TrendRadar's configuration system is config/config.yaml. This YAML file controls virtually every aspect of the application's behavior, from scheduling and data sources to AI model settings and notification channels.

Key sections within config/config.yaml include:

  • Time zone and scheduling settings — Define when the application runs and in which time zone it operates
  • Platform sources and RSS feeds — Configure where TrendRadar pulls data from
  • Reporting mode and notification channels — Set up how and where alerts are delivered
  • Storage back-ends — Choose where processed data persists
  • Filter strategy — Select between keyword or ai filtering approaches
  • AI model settings — Configure API keys, model selection, and related parameters

Supporting Configuration Files in config/

Beyond the main configuration file, several specialized files in the config/ directory provide data for specific features:

Timeline and Scheduling

config/timeline.yaml contains timeline definitions that drive the scheduler. This file determines when TrendRadar pushes updates, runs AI analysis, and performs other time-based operations.

Keyword-Based Filtering

config/frequency_words.txt provides the keyword list used when the filter method is set to keyword. Each line contains a keyword and its frequency weight, enabling fine-grained control over which trends surface.

AI-Based Filtering

config/ai_interests.txt supplies default interest descriptions consumed by the ai filter. This helps the AI model understand what topics to prioritize when classifying trends.

AI Prompt Templates

Several files in config/ai_filter/ and the root config/ directory contain prompt templates for various AI operations:

File Purpose
config/ai_filter/prompt.txt Main AI classification prompt
config/ai_filter/extract_prompt.txt Tag extraction from titles
config/ai_filter/update_tags_prompt.txt Tag updates after interest changes
config/ai_analysis_prompt.txt AI analysis of news content
config/ai_translation_prompt.txt AI-powered translation

Files at Repository Root That Influence Behavior

While not considered "user-editable" configurations in the traditional sense, several files at the repository root affect how TrendRadar runs:

  • requirements.txt — Python package dependencies
  • pyproject.toml — Build metadata and tool configuration
  • docker/.env — Runtime secrets for containerized deployments (kept separate for security)

Important distinction: These files are typically managed by developers or deployment tooling, not end users. The config/ directory remains the authoritative location for operational settings that users directly modify.

Working with Configuration Files Programmatically

The following examples demonstrate how TrendRadar's core modules load and interact with these configuration files.

Loading the Main Configuration

import yaml
from pathlib import Path

CONFIG_PATH = Path(__file__).parent.parent / "config" / "config.yaml"

with CONFIG_PATH.open("r", encoding="utf-8") as f:
    cfg = yaml.safe_load(f)

# Access specific configuration values

print("Timezone:", cfg["app"]["timezone"])
print("Filter method:", cfg["filter"]["method"])

Reading Keyword Frequencies

import pathlib

FREQ_WORDS = pathlib.Path(__file__).parent.parent / "config" / "frequency_words.txt"

keywords = []
with FREQ_WORDS.open("r", encoding="utf-8") as f:
    for line in f:
        line = line.strip()
        if line and not line.startswith("#"):
            keywords.append(line.split()[0])  # First column is the keyword

print(f"Loaded {len(keywords)} frequency words")

Accessing AI Configuration


# After loading cfg as shown above

ai_cfg = cfg["ai"]

print("AI model:", ai_cfg["model"])
print("API endpoint:", ai_cfg.get("api_base", "default"))
print("Temperature:", ai_cfg.get("temperature", 0.7))

These patterns mirror the implementation found in trendradar/core/config.py and related modules.

Summary

  • All user-editable configuration files in TrendRadar reside in the config/ directory at the repository root.
  • config/config.yaml serves as the central configuration file, controlling application behavior, scheduling, data sources, filtering, and AI settings.
  • Supporting files like timeline.yaml, frequency_words.txt, ai_interests.txt, and various prompt templates provide specialized data for specific features.
  • Root-level files such as requirements.txt and pyproject.toml influence runtime behavior but are developer-managed rather than user-configured.
  • Consistent loading patterns using pathlib and PyYAML enable reliable access to configuration values throughout the codebase.

Frequently Asked Questions

What is the main configuration file in TrendRadar?

The main configuration file is config/config.yaml. This file controls all runtime aspects of the application, including time zone settings, scheduling parameters, data source configurations, notification channels, storage backends, and AI model settings. When TrendRadar starts, it loads this file to determine how to operate.

How do I switch between keyword and AI filtering in TrendRadar?

To change the filtering method, modify the filter.method value in config/config.yaml. Set it to keyword to use the frequency-based keyword list from config/frequency_words.txt, or set it to ai to enable AI-powered classification using the prompts and interest definitions in config/ai_interests.txt and config/ai_filter/.

Are there any secret configuration files in TrendRadar's root directory?

No sensitive configuration files are stored directly in the repository root. Runtime secrets for containerized deployments are kept in docker/.env, which is located in the docker/ subdirectory and typically excluded from version control via .gitignore. This separation ensures that API keys, database credentials, and other secrets remain secure while the main configuration files in config/ can be safely versioned and shared.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →