How bangoc123/protonx-agent-01-class works
Project Type and Purpose
• The README (“ProtonX Agent Class 01”) and the link (presumably to a course page) indicate that this project is used in an educational setting to illustrate how agents (or “MCP” servers/clients) interact.
• The examples range from simple agents (like rag-practice) to more structured client/server demos (mcp-server-demo, rag-mcp-server, simple-mcp, weather-demo). They focus on agent-driven interactions, vector search/building, and the use of databases (both binary files and SQLite for “chroma”).
File Structure
• At the top level, you have multiple “Day” directories that group different exercises/demos.
• Within Day‑2, the “rag-practice” folder includes files for vector search (“build-vector-search.py”) and agent components (“rag.py”, “rag-agent.py”, and even a “simple-react-agent.py”). The associated “db” folder holds data files (binary files organized in unique identifier directories) and a SQLite database (“chroma.sqlite3”). This indicates that the system interacts with both low-level binary structures and higher-level retrieval structures.
• Day‑3 contains several subprojects:
• “practice-in-class/mcp-server-demo” shows a classical client-server architecture (client.py and server.py).
• “rag-mcp” mirrors the rag-practice structure but in the context of an MCP server, complete with its own database, supporting files like prompts.py and tools.py.
• “simple-mcp” breaks down the core concepts (prompt, resource, server, tool) into separate directories. This reinforces the idea of modular, component-based design.
• “weather-demo” further shows how a complete client-server system can interact, likely integrating weather data with the MCP agent framework.
• Consistent use of configuration files (like pyproject.toml, requirements.txt, .python-version, and uv.lock) which implies a reliance on Python’s ecosystem and environment management.
Main Components of the System
• Agent Modules: These include files like rag.py, rag-agent.py, and the various server.py in the different demos. They are responsible for handling agent logic.
• Client Modules: Some demos manifest a clear client component (e.g., client.py in mcp-server-demo and weather-demo).
• Database Layer: There is a low-level “db” folder with binary files (data_level0.bin, link_lists.bin, etc.) and an SQLite file (chroma.sqlite3). This is used for storing and retrieving vector indexes and possibly prompt or tool data.
• Core Concept Modules: In simple-mcp, the separation of “prompt-concept”, “resource-concept”, “server-concept”, and “tool-concept” emphasizes modular decomposition of agent capabilities.
Relationships and Interactions
• Data Flow: Clients (e.g., in mcp-server-demo or weather-demo) send requests to the Server (MCP or RAG based) which in turn queries the vector database (or uses prompt/tools modules) to respond.
• Agents might be abstracted as “middleware” that integrates the retrieval component (vector search from database files) with appropriate decision-making or tool invocation (as seen in simple-mcp).
• In the rag-mcp folder, you see a clear structure indicating that prompts, tools, and databases work in unison within a server process.