A wallet-based vector database management system built with Pinecone, Supabase, and Skynet integration. This system provides both Agent-level and Collection-level knowledge storage with comprehensive access control and authentication.
- Dual-Level Storage: Agent-level and Collection-level knowledge bases
- AI-Powered Operations: Natural language processing for CRUD operations
- Access Control: Comprehensive authentication and authorization system
- Vector Search: Semantic search capabilities with Pinecone integration
- Blockchain Integration: Wallet-based authentication with Skynet
- Cost Management: Dynamic pricing based on operation type and data size
- Ownership Verification: Smart contract-based ownership validation
- Express.js Server: RESTful API backend
- Pinecone: Vector database for semantic search
- Supabase: PostgreSQL database for metadata and access control
- Skynet: Blockchain integration for wallet authentication
- AI Access Point: Natural language processing for operations
- Authentication: Wallet signature verification
- Ownership Verification: Smart contract-based access validation
- Authorization: Access control validation at agent and collection levels
- AI Processing: Natural language to operation extraction
- Database Operations: CRUD operations on knowledge base
- Cost Calculation: Dynamic pricing based on operation complexity
The system uses a multi-layered authentication approach:
-
Wallet Authentication
- Users authenticate using their wallet signature
-
userAuthPayload
contains wallet address and authentication details - Each operation is tied to the authenticated wallet address
-
Agent-Based Access Control
- Agent ownership grants access to personal knowledge base
-
agentCollection
contains agent address and agent ID - Each agent has isolated storage with unique indexing
-
Collection-Level Access Control
- Collection owners can manage shared knowledge bases
-
agentCollection
with null/empty agentID triggers collection-level operations - Ownership verification through smart contract interaction
The system implements comprehensive ownership verification:
- Validates collection ownership first
- Then validates specific agent ownership within the collection
- Uses smart contract calls to verify on-chain ownership
- Validates collection ownership directly
- Applies when
agentID
is null, empty, or operation explicitly requests collection-level access - Uses RPC calls to verify smart contract ownership
The AccessControlService
manages permissions for both levels:
- Grant Access: Associates agent with specific records
- Verify Access: Validates agent ownership for record operations
- Update Timestamps: Maintains activity tracking
- Owner Verification: Validates collection ownership via smart contract
- Editable Flags: Controls whether records can be modified
- Non-Editable Records: Support for read-only collection records
AgentAccessControl (
id: UUID PRIMARY KEY,
agent_address: TEXT NOT NULL,
agent_id: TEXT NOT NULL,
record_id: TEXT NOT NULL,
index_name: TEXT NOT NULL,
created_at: TIMESTAMP DEFAULT NOW(),
updated_at: TIMESTAMP DEFAULT NOW()
)
CollectionAccessControl (
id: UUID PRIMARY KEY,
agent_address: TEXT NOT NULL,
record_id: TEXT NOT NULL,
index_name: TEXT NOT NULL,
editable: BOOLEAN DEFAULT true,
created_at: TIMESTAMP DEFAULT NOW(),
updated_at: TIMESTAMP DEFAULT NOW()
)
Basic Save Operations:
- Save: Google LLC is an American multinational technology company focusing on artificial intelligence, online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, and consumer electronics
- Store this information: Machine learning is a subset of artificial intelligence that uses statistical techniques to give computer systems the ability to learn from data without being explicitly programmed
- Remember that: The capital of France is Paris, which is also the most populous city in France with over 2 million inhabitants
- Add to my knowledge base: Python is a high-level programming language known for its simplicity and readability, widely used in data science, web development, and artificial intelligence
- Save this fact: The Great Wall of China is approximately 13,170 miles long and was built over many centuries by various Chinese dynasties
- Save: React is a JavaScript library for building user interfaces, developed by Facebook, that uses a component-based architecture and virtual DOM for efficient rendering
- Store: Blockchain technology is a distributed ledger system that maintains a continuously growing list of records linked and secured using cryptography
- Remember: Database normalization is the process of organizing data in a database to reduce redundancy and improve data integrity through various normal forms
- Add: REST API stands for Representational State Transfer Application Programming Interface, which uses HTTP methods like GET, POST, PUT, and DELETE
- Save: Amazon Web Services is a comprehensive cloud computing platform that offers over 200 services including computing power, database storage, and content delivery
Collection-Level Save Operations:
- Save this data to the collection knowledge base: Company policies regarding remote work include flexible scheduling, home office equipment allowances, and quarterly team building events
- Store this at the collection level: Our product roadmap for 2024 includes mobile app development, API v2 release, and integration with major CRM platforms
- Save to collection: Team contact information - Engineering: engineering@company.com, Sales: sales@company.com, Support: support@company.com
- Collection-level storage: Brand guidelines specify primary colors as #FF6B35 (orange) and #004225 (dark green), with Helvetica as the primary font family
- Save this to the collection knowledge base and make it non editable: Security protocols require two-factor authentication for all administrative accounts and monthly security audits
Advanced Save Operations:
- Store this: Agile methodology is an iterative approach to project management and software development that emphasizes flexibility, collaboration, and customer satisfaction through adaptive planning and evolutionary development
- Remember: Tesla Inc is an American electric vehicle and clean energy company founded by Elon Musk that also produces battery energy storage systems and solar panels, with a mission to accelerate sustainable transport
- Add to knowledge: The stock market is a collection of markets where stocks representing ownership claims on businesses are issued and traded, influenced by economic indicators, company performance, and investor sentiment
- Save: Kubernetes is an open-source container orchestration platform that automates deployment, scaling, and management of containerized applications across clusters of hosts
- Store this information: Artificial Neural Networks are computing systems inspired by biological neural networks, consisting of interconnected nodes that process information using connectionist approaches to computation
Extended Long Save Operations:
- Save: Docker is a containerization platform that uses OS-level virtualization to deliver software in packages called containers. It enables developers to package applications with all dependencies into lightweight, portable containers that can run consistently across different environments. Docker containers share the host OS kernel, making them more efficient than traditional virtual machines. The platform includes Docker Engine for running containers, Docker Hub for sharing container images, and Docker Compose for defining multi-container applications. Docker has revolutionized software deployment by solving the "it works on my machine" problem and enabling microservices architecture, continuous integration, and DevOps practices.
- Store this comprehensive information: Cloud computing represents a paradigm shift in how computing resources are delivered and consumed, offering on-demand access to a shared pool of configurable computing resources including networks, servers, storage, applications, and services. The three primary service models are Infrastructure as a Service (IaaS) which provides virtualized computing resources, Platform as a Service (PaaS) which offers development platforms and tools, and Software as a Service (SaaS) which delivers complete applications over the internet. Major cloud providers like Amazon Web Services, Microsoft Azure, and Google Cloud Platform offer global infrastructure with high availability, scalability, and security features. Cloud computing enables organizations to reduce capital expenditure, improve operational efficiency, enhance disaster recovery capabilities, and accelerate innovation through rapid provisioning of resources.
- Remember this detailed explanation: Artificial Intelligence encompasses a broad range of technologies and methodologies designed to create systems that can perform tasks typically requiring human intelligence. Machine Learning, a subset of AI, uses statistical techniques to enable computers to learn and improve from experience without explicit programming. Deep Learning, further specialized within ML, employs artificial neural networks with multiple layers to model and understand complex patterns in data. Natural Language Processing enables machines to understand, interpret, and generate human language, powering applications like chatbots, translation services, and voice assistants. Computer Vision allows machines to interpret and understand visual information from the world, enabling applications in autonomous vehicles, medical imaging, and facial recognition. Reinforcement Learning involves training agents to make decisions through trial and error in dynamic environments, leading to breakthroughs in game playing, robotics, and autonomous systems.
- Add to knowledge base: Blockchain technology represents a revolutionary approach to data storage and transaction processing, utilizing a distributed ledger system that maintains a continuously growing list of records called blocks, which are linked and secured using cryptographic hashes. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data, creating an immutable chain of records. The decentralized nature of blockchain eliminates the need for intermediaries, enabling peer-to-peer transactions with increased transparency, security, and trust. Consensus mechanisms like Proof of Work and Proof of Stake ensure network integrity and prevent double-spending. Beyond cryptocurrency applications, blockchain enables smart contracts, supply chain tracking, digital identity management, decentralized finance (DeFi), and non-fungible tokens (NFTs), promising to transform industries from finance to healthcare.
- Save this extensive information: Cybersecurity is a critical discipline focused on protecting digital systems, networks, and data from cyber threats, attacks, and unauthorized access. It encompasses multiple layers of protection including network security through firewalls and intrusion detection systems, endpoint security with antivirus and anti-malware solutions, application security through secure coding practices and vulnerability assessments, and data security via encryption and access controls. Common threats include malware, phishing attacks, ransomware, distributed denial-of-service attacks, and social engineering. Security frameworks like NIST Cybersecurity Framework and ISO 27001 provide structured approaches to risk management. Emerging challenges include securing Internet of Things devices, protecting cloud infrastructure, addressing insider threats, and defending against advanced persistent threats. The field requires continuous learning due to evolving threat landscapes and the need for security awareness training across organizations.
- Store: Quantum computing represents a fundamental shift from classical computing, leveraging quantum mechanical phenomena such as superposition and entanglement to process information in ways that classical computers cannot. While classical bits exist in definite states of 0 or 1, quantum bits (qubits) can exist in superposition states, allowing quantum computers to explore multiple solutions simultaneously. Quantum entanglement enables qubits to be correlated in ways that enhance computational power exponentially for certain problems. Current quantum computers face challenges including quantum decoherence, error rates, and the need for extremely low temperatures. However, they show promise for solving complex optimization problems, cryptographic challenges, drug discovery, financial modeling, and artificial intelligence applications. Major technology companies and research institutions are racing to achieve quantum supremacy and develop fault-tolerant quantum computers that could revolutionize computing within the next decade.
- Remember this comprehensive overview: Software engineering is a systematic approach to designing, developing, and maintaining large-scale software systems through disciplined engineering practices. It encompasses requirements analysis to understand user needs, system design to create architectural blueprints, implementation using appropriate programming languages and frameworks, testing to ensure quality and reliability, and maintenance to evolve systems over time. Software development methodologies include Waterfall for sequential development, Agile for iterative and collaborative approaches, Scrum for sprint-based teamwork, and DevOps for continuous integration and deployment. Design patterns provide reusable solutions to common programming problems, while software architecture patterns like microservices, event-driven architecture, and layered architecture guide system organization. Quality assurance involves unit testing, integration testing, system testing, and user acceptance testing. Modern software engineering emphasizes clean code principles, version control with Git, continuous integration, automated testing, and collaborative development practices.
- Add this detailed information: Internet of Things (IoT) refers to the interconnected network of physical devices embedded with sensors, software, and connectivity capabilities that enable them to collect and exchange data over the internet. IoT devices range from simple sensors measuring temperature and humidity to complex systems like smart vehicles and industrial machinery. The IoT ecosystem includes device hardware with microcontrollers and communication modules, connectivity protocols such as WiFi, Bluetooth, cellular, and LPWAN, cloud platforms for data processing and storage, and applications that provide user interfaces and analytics. Key challenges include security vulnerabilities due to limited processing power for encryption, privacy concerns with personal data collection, interoperability issues between different manufacturers, and scalability challenges as networks grow. IoT applications span smart homes with connected appliances, smart cities with traffic management and environmental monitoring, industrial IoT for manufacturing optimization, healthcare monitoring with wearable devices, and agriculture with precision farming techniques.
- Save this comprehensive explanation: Data science is an interdisciplinary field that combines statistical analysis, machine learning, data visualization, and domain expertise to extract insights and knowledge from structured and unstructured data. The data science process typically follows the CRISP-DM methodology including business understanding, data understanding through exploratory data analysis, data preparation involving cleaning and feature engineering, modeling using statistical and machine learning techniques, evaluation of model performance, and deployment into production systems. Essential tools include programming languages like Python and R, data manipulation libraries such as Pandas and dplyr, visualization tools like Matplotlib and ggplot2, and machine learning frameworks including scikit-learn and TensorFlow. Big data technologies like Hadoop, Spark, and distributed databases enable processing of large datasets. Data scientists must understand statistical concepts, possess programming skills, have domain knowledge relevant to their industry, and communicate findings effectively to stakeholders through compelling visualizations and reports.
- Store this detailed technical overview: Web development encompasses the creation of websites and web applications using a combination of client-side and server-side technologies. Frontend development focuses on user interface and user experience using HTML for structure, CSS for styling and layout, and JavaScript for interactivity and dynamic behavior. Modern frontend frameworks like React, Angular, and Vue.js provide component-based architectures for building complex user interfaces. Backend development involves server-side logic using languages like Node.js, Python, PHP, or Java, along with databases for data persistence and APIs for communication between frontend and backend systems. Full-stack development combines both frontend and backend skills. Web development includes responsive design for mobile compatibility, progressive web applications for native-like experiences, search engine optimization for visibility, accessibility compliance for inclusive design, and performance optimization for fast loading times. Development workflows incorporate version control, automated testing, continuous integration, and deployment pipelines to ensure reliable and maintainable web applications.
Simple Queries:
- What is Google?
- Tell me about machine learning
- What do you know about Paris?
- Explain Python programming
- What is the Great Wall of China?
- How does React work?
- What is blockchain technology?
- Explain database normalization
- What is a REST API?
- Tell me about microservices architecture
Collection-Level Queries:
- Ask the collection about our company policies
- Query collection knowledge about the product roadmap
- What does the collection know about team contacts?
- Collection knowledge about brand guidelines
- Ask the collection about security protocols
Advanced Queries:
- What programming languages do you know about?
- Tell me about cloud computing platforms
- What information do you have about AI technologies?
- Explain the software development methodologies you know
- What do you know about database technologies?
Basic List Commands:
- List all my records
- Show me everything I've saved
- What information do I have?
- Display all my knowledge
- Show all stored data
- What's in my knowledge base?
- List everything
- Show my saved information
- Display all records
- What have I stored?
Collection-Level List Commands:
- List collection records
- Show me all collection-level data
- What's stored in the collection knowledge base?
- Display collection records
- List all collection information
Basic Update Commands:
- Update the Google information with new details: Google LLC is an American multinational technology company that specializes in Internet-related services and products, including online advertising technologies, search engines, cloud computing, software, and hardware. ID: abc123def456
- Change the record about Python to include: Python is an interpreted, high-level programming language with dynamic semantics, created by Guido van Rossum and first released in 1991. ID: abc123def456
- Modify the machine learning definition with: Machine learning is a method of data analysis that automates analytical model building using algorithms that iteratively learn from data. ID: abc123def456
- Update information about Tesla: Tesla Inc is an American electric vehicle and clean energy company based in Austin, Texas, known for electric cars, battery energy storage, and solar panels. ID: abc123def456
- Update the React information to include performance details: React is a JavaScript library that uses virtual DOM for efficient updates and supports server-side rendering for better performance. ID: abc123def456
Collection-Level Update Commands:
- Update the collection knowledge base about company policies: Remote work policies now require daily check-ins and weekly team meetings. ID: abc123def456
- Collection-level update for product roadmap: Q1 2024 will focus on mobile app beta testing and API v2 documentation. ID: abc123def456
- Update collection record about brand guidelines: Added new logo variations for dark backgrounds and social media usage. ID: abc123def456
Basic Delete Commands:
- Delete the record about Google. ID: abc123def456
- Remove the Python information. ID: abc123def456
- Delete record about machine learning. ID: abc123def456
- Remove the Tesla information from my knowledge base. ID: abc123def456
Collection-Level Delete Commands:
- Delete from collection the outdated company policy. ID: abc123def456
- Remove this collection record about the old product roadmap. ID: abc123def456
- Collection-level delete for the deprecated brand guidelines. ID: abc123def456
Basic Get Commands:
- Get the record about Google. ID: abc123def456
- Show me the Python information. ID: abc123def456
- Retrieve the machine learning definition. ID: abc123def456
- Get record about Tesla. ID: abc123def456
Collection-Level Get Commands:
- Get collection record about company policies. ID: abc123def456
- Show me the collection-level product roadmap. ID: abc123def456
- Retrieve collection record about brand guidelines. ID: abc123def456
- Node.js (v16 or higher)
- PostgreSQL database
- Pinecone API key
- Supabase project
- Skynet wallet configuration
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/knowledge_base
# Vector Database
PINECONE_API_KEY=your_pinecone_api_key
# Blockchain
PROVIDER_RPC=https://rpc.skynet.io
WALLET_PRIVATE_KEY=your_wallet_private_key
SUBNET_ID=your_subnet_id
SERVER_COST_CONTRACT_ADDRESS=your_contract_address
# Server
PORT=3003
# Clone the repository
git clone <repository-url>
cd accesspoint_knowledge_base
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
# For development
npm run dev
POST /natural-request
Request payload structure:
{
"prompt": "Natural language command",
"userAuthPayload": {
"userAddress": "wallet_address",
"signature": "wallet_signature"
},
"accountNFT": {
"collectionID": "collection_id",
"nftID": "nft_id"
},
"agentCollection": {
"agentAddress": "agent_contract_address",
"agentID": "agent_id"
}
}