How superioragents/superior-agents works
Main Components
• Agent Module: This is the core Python-based agent that handles both trading and marketing. It has its own directory with subdirectories for scripts, core source code (agent/src), configurations (agent/starter JSONs for marketing and trading), Docker settings (agent/docker), and dependency management (requirements, pyproject.toml).
• Meta-Swap API: A Node/TypeScript-based service (indicated by package.json, Dockerfile, and source code under meta-swap-api/src) dedicated to handling swap operations. It manages blockchain interactions (addresses, signers, swap providers) and exposes endpoints for swap functionality.
• Notification Service: A Python service that aggregates data from various sources (e.g., scraping Twitter data) to feed agent information into the system. It is containerized (Dockerfile, docker-compose.yml) and contains components for cron jobs and server functionality.
• rag-api: Another Python service responsible for retrieval or processing (likely related to retrieval-augmented generation “RAG”) although simpler in structure (only a few scripts) than the others.
• REST API for the Python Server-side: A FastAPI-based backend structured under rest-api. It manages database interactions (agent_sessions, chat_history, notifications, payments, etc.), application routes, and utility functions. It is set up to initialize databases, and allows agents to interact with the system via APIs.
• External Configuration/Integration: There are several environment variables across components ensuring connectivity to external APIs (Twitter, blockchain providers, etc.), plus specialized configuration such as Ethereum private keys and ABI files for interacting with smart contracts.
Relationships & Interactions
• The Agent Module interacts with:
• The Python server’s REST API (acting as a backend database or orchestration engine).
• Token swapping through integration with the Meta-Swap API.
• Not only does it interact with external blockchain networks (via provided ABI files) for trading, but also uses the configuration JSON files to dictate behavior.
• The Meta-Swap API provides transactional endpoints to facilitate swaps. It interacts with blockchain helpers, signers (eth and sol services), and multiple swap providers (eg. 1inch, Kyber, etc.).
• The Notification Service collects data (market trends, Twitter feeds, etc.) that are later utilized by the agents to assess performance and adjust strategies.
• The rag-api may act as a data aggregator or preprocessing service for agent workflows (for instance, providing enhanced data via retrieval augmented generation flows).
• The REST API is the central point of integration that allows agents and external services like the notification service to interact with persistent data (users, agent sessions, wallet snapshots, etc.).
Architectural Patterns & Design Principles
• Modular architecture: Separation of concerns is evident between the trading/marketing agent, swap API, notifications, and REST services, which could be deployed independently.
• Microservices pattern: Each component (agent, meta-swap-api, notification, rag-api, and rest-api) is containerized using Docker. They likely communicate over defined APIs.
• Containerization & Deployment: Multiple Dockerfiles and docker-compose configurations indicate an emphasis on reproducible environments and container orchestration.
• Use of configuration files and environment variables: These outline how external integrations (APIs, blockchain connectivity, etc.) are provided, ensuring a clear separation between code and sensitive data/configuration.
• Extensibility: The agent’s configurable JSON files (marketing.json, trading.json) allow dynamic behavior and underscore both configuration-driven development and plug-and-play extensibility.
Final Recommendations
• Then progressively refine to add submodules (for example, under the agent module, illustrate where trading and marketing logic reside).
• That integration points for external APIs (Twitter, blockchain nodes, etc.) are clearly marked.