A sophisticated AI-powered funding platform that intelligently matches donors with impactful projects and campaigns on the NEAR blockchain. The platform uses advanced search algorithms, vector similarity, and LLM-based evaluation to provide personalized funding recommendations.
- ๐ Intelligent Search: Vector similarity search across projects and campaigns
- ๐ค AI-Powered Evaluation: LLM-based relevance scoring and holistic evaluation
- ๐ Smart Ranking: Hybrid ranking combining similarity scores and AI evaluation
- ๐ฏ Personalized Recommendations: Weighted allocation based on user preferences
- ๐ Multi-Platform Integration: Support for projects and campaigns from Potlock ecosystem
- Unified Search: Search across both projects and campaigns simultaneously
- Tabbed Interface: View "All", "Projects", or "Campaigns" separately
- Real-time Results: Live data fetching from NEAR smart contracts
- Rich Metadata: Display images, descriptions, social links, and evaluation scores
- Relevance Scoring: AI evaluation of query relevance (0-10 scale)
- Impact Assessment: Evaluation of project/campaign potential impact
- Funding Needs Analysis: Assessment of funding requirements and urgency
- Holistic Reports: Comprehensive evaluation reports for each item
- Framework: Next.js 14 with TypeScript
- Styling: Tailwind CSS with custom design system
- State Management: React hooks with local state
- UI Components: Custom components with responsive design
- Icons: Feather Icons for consistent iconography
- Search Engine: LangChain MemoryVectorStore for vector similarity search
- Embeddings: OpenAI text-embedding-ada-002 for semantic search
- LLM Integration: OpenAI GPT-3.5-turbo for evaluation and ranking
- API Routes: Next.js API routes for search functionality
- NEAR Protocol: Direct integration with NEAR blockchain
- Smart Contracts:
- Potlock Projects Contract (
v1.social08.near
) - Potlock Campaigns Contract (
v1.campaigns.staging.potlock.near
)
- Potlock Projects Contract (
- Data Fetching: Real-time data from NEAR RPC endpoints
- Profile Enrichment: Integration with
social.near
for project metadata
- Data Ingestion: Fetch projects and campaigns from smart contracts
- Vector Embedding: Convert text content to vector embeddings
- Similarity Search: Find relevant items using vector similarity
- LLM Reranking: Use GPT-3.5-turbo to rerank results by relevance
- Holistic Evaluation: Generate comprehensive evaluation reports
- Scoring: Assign scores for relevance, impact, and funding needs
- Weighted Allocation: Calculate allocation percentages based on scores
// Hybrid search combining vector similarity and LLM evaluation
const searchPipeline = async (query: string) => {
// 1. Vector similarity search
const vectorResults = await vectorStore.similaritySearch(query, topK);
// 2. LLM reranking
const rerankedResults = await rerankWithOpenAI(query, vectorResults);
// 3. Holistic evaluation
const evaluations = await Promise.all(
rerankedResults.map(result => generateEvaluationReport(query, result))
);
// 4. Scoring and allocation
const scoredResults = await Promise.all(
evaluations.map(evaluation => scoreEvaluationReport(evaluation))
);
return scoredResults;
};
- Project Data: Enriched with profile information from
social.near
- Campaign Data: Direct from Potlock campaigns contract
- Image Handling: IPFS integration for project logos and images
- Social Links: Automatic URL formatting for various platforms
The platform automatically formats social media URLs:
- Twitter/X:
https://x.com/{username}
- GitHub:
https://github.com/{username}
- Telegram:
https://t.me/{username}
- Discord:
https://discord.gg/{invite}
- LinkedIn:
https://www.linkedin.com/in/{profile}
- Website:
https://{domain}
funding-ai/
โโโ src/
โ โโโ app/
โ โ โโโ api/
โ โ โ โโโ search/
โ โ โ โโโ route.ts # Search API endpoint
โ โ โโโ dashboard/
โ โ โ โโโ page.tsx # Dashboard page
โ โ โโโ globals.css # Global styles
โ โ โโโ layout.tsx # Root layout
โ โ โโโ page.tsx # Main search interface
โ โโโ components/
โ โ โโโ Footer.tsx # Footer component
โ โ โโโ Header.tsx # Header component
โ โโโ contexts/
โ โโโ WalletSelectorContext.tsx # NEAR wallet integration
โโโ package.json # Dependencies and scripts
โโโ tailwind.config.js # Tailwind configuration
โโโ tsconfig.json # TypeScript configuration
- Node.js 18+
- npm or yarn
- NEAR account (for blockchain interactions)
- OpenAI API key (for AI features)
-
Clone the repository:
git clone https://github.com/yourusername/funding-ai.git cd funding-ai
-
Install dependencies:
npm install
-
Environment setup:
cp .env.example .env.local # Add your OpenAI API key and other environment variables
-
Run development server:
npm run dev
-
Open http://localhost:3000 in your browser
OPENAI_API_KEY=your_openai_api_key_here
NEAR_NETWORK_ID=testnet
NEAR_NODE_URL=https://rpc.testnet.near.org
- Enter your funding interests in the search bar
- Browse results across the "All", "Projects", and "Campaigns" tabs
- Review evaluation scores for relevance, impact, and funding needs
- Select items you want to fund
- Configure funding amount and strategy
- Execute donations through the funding modal
- Real-time search: Results update as you type
- Smart suggestions: Pre-defined search suggestions for common interests
- Rich results: View images, descriptions, social links, and evaluation scores
- Campaign URLs: Direct links to campaign pages on Potlock platform
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript type checking
- Vector similarity search using LangChain
- LLM-based reranking with OpenAI GPT-3.5-turbo
- Holistic evaluation with comprehensive scoring
- Real-time data fetching from NEAR smart contracts
- Responsive design with Tailwind CSS
- Tabbed interface for different result types
- Modal system for detailed item views
- Funding workflow with amount selection and strategy
- Project enrichment with social.near integration
- Campaign data from Potlock contracts
- Image handling with IPFS integration
- Social link formatting for various platforms
- Advanced filtering by category, funding amount, and impact area
- User preferences and personalized recommendations
- Donation history and tracking
- Social features for sharing and collaboration
- Analytics dashboard for funding impact
- Caching layer for improved performance
- Real-time updates for live data
- Advanced AI models for better evaluation
- Multi-chain support for other blockchains
- Mobile app for on-the-go funding
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- NEAR Protocol for blockchain infrastructure
- Potlock for campaign and project data
- OpenAI for AI capabilities
- LangChain for vector search functionality
- Tailwind CSS for styling framework
Built with โค๏ธ for the NEAR ecosystem