# CrewAI

This is a demo project to showcase and test how cognee and CrewAI can work together:

Short description:

We simulate the hiring process for a technical role. These are the steps of the pipeline:

1. First we ingest github data including:
    -commits, comments and other soft skill related information for each of the candidates.
    -source code and other technical skill related information for each of the candidates.

2. We hire 3 agents to make the decision using cognee's memory engine

    1 - HR Expert Agent focusing on soft skills:
        - Analyzes the communication skills, clarity, engagement a kindness based on the commits, comments and github communication of the candidates.
            -To analyze the soft skills of the candidates, the agent performs multiple searches using cognee.search
            -The subgraph that the agent can use is limited to the "soft" nodeset subgraph
        - Scores each candidate from 0 to 1 and gives reasoning

    2 - Technical Expert Agent focusing on technical skills:
        - Analyzes strictly code related and technical skills based on github commits and pull requests of the candidates.
            - To analyze the technical skills of the candidates, the agent performs multiple searches using cognee.search
            - The subgraph that the agent can use is limited to the "techical" nodeset subgraph
        - Scores each candidate from 0 to 1 and gives reasoning

    3 - CEO/CTO agent who makes the final decision:
        - Given the output of the HR expert and Technical expert agents, the decision maker agent makes the final decision about the hiring procedure.
        - The agent will choose the best candidate to hire, and will give reasoning for each of the candidates (why hire/no_hire).


The following tools were implemented:
    - Cognee build: cognifies the added data (Preliminary task, therefore it is not performed by agents.)
    - Cognee search: searches the cognee memory, limiting the subgraph using the nodeset subgraph retriever (Used by many agents)
        - In the case of technical and soft skills agents the tool gets instantiated with the restricted nodeset search capability


The three agents are working together to simulate a hiring process, evaluating soft and technical skills, while the CEO/CTO agent
makes the final decision (HIRE/NOHIRE) based on the outputs of the evaluation agents.


## Run in UI

Note1: After each restart go to `localhost:3000/auth` and login again.
Note2: Activity is not preserved in the DB, so it will be lost after page refresh.

1. Start FastAPI server by running `client.py` inside `cognee/api` directory
2. Start NextJS server by running `npm run dev` inside `cognee-frontend` directory.
3. If you are not logged-in, app will redirect to `/auth` page. Otherwise go there manually and login (if server is restarted).
