AskChain is a crypto-incentivized Q&A platform that allows users to earn cryptocurrency rewards for answering academic questions. The platform integrates AI agents specializing in mathematics, physics, and computer science to provide high-quality responses, while users can compete against AI to provide superior answers and earn ASK tokens.
Many online Q&A platforms lack proper incentives for experts to contribute high-quality answers. AskChain solves this by introducing a blockchain-based reward system, ensuring faster, more accurate responses while promoting knowledge-sharing.
- Incentivized Learning: Users can earn ASK tokens by providing valuable answers.
- AI-Assisted Responses: Specialized AI agents assist in answering complex academic queries.
- Decentralized Trust: Smart contracts ensure fairness in reward distribution.
- Blockchain: Solidity (for smart contracts and token rewards)
- Frontend: Next.js (React framework for UI)
- Backend: Flask (for handling API endpoints)
- AI: LangChain (for building AI-powered agents)
- Database: PostgreSQL (for storing data)
apps/agents/- Contains specialized AI agentsapps/endpoints/- Flask API endpoints for handling requestscontracts/- Solidity smart contracts for token rewardsfrontend/- Next.js code for the user interface
Refer to the individual README.mds in apps/endpoints,apps/agents,apps/web for more specific run & setup instructions.
To set up the project locally:
-
Clone the repository:
git clone https://github.com/monopoly21/askChain.git
-
Navigate to the project directory:
cd askChain -
Install dependencies:
- Ensure you have Python installed.
- Install required Python packages:
pip install -r requirements.txt
-
Create .env files
- Create 2
.envfiles, one in the root directory and one inapps/web, hereby referred to as A and B respectively - In A, provide your
GROQ_API_KEY, that's all that is required - In B, follow the format provided by
apps/web/env_example.txt. Remember to save B inapps/web/
- Create 2
-
Run the Agent Server
- While in the root directory, start the Flask application:
python -m apps.endpoints.ask_endpoints
- While in the root directory, start the Flask application:
-
Run the web app
- Run the following instructions in sequence from the
apps/webdirectory:
- Run the following instructions in sequence from the
npm install
npx prisma migrate dev
npx prisma generate client
npm run devFinally, access the app on port 3000
Run a standalone server for the Agents:
- While in the root directory, start the Flask application:
python -m apps.endpoints.ask_endpointsRun a standalone server for Agent Fine-Tuning:
- While in the root directory, start the Flask application:
python -m apps.endpoints.finetune_endpointNOTE: Only run the endpoints from the project directory.
Contributions are welcome! Please fork the repository and create a pull request with your changes. Ensure that your code adheres to the project's coding standards and includes appropriate tests.
For questions or suggestions, please open an issue in this repository or contact the project maintainers.
