daddyofadoggy commited on
Commit
c4cd8f0
Β·
1 Parent(s): 8db1deb

Added SQL fileto demostrate database set up

Browse files
Files changed (2) hide show
  1. README.md +10 -2
  2. supabase_sql_setup.sql +41 -0
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Template Final Assignment
3
  emoji: πŸ•΅πŸ»β€β™‚οΈ
4
  colorFrom: indigo
5
  colorTo: indigo
@@ -12,4 +12,12 @@ hf_oauth: true
12
  hf_oauth_expiration_minutes: 480
13
  ---
14
 
15
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: GAIA Agent
3
  emoji: πŸ•΅πŸ»β€β™‚οΈ
4
  colorFrom: indigo
5
  colorTo: indigo
 
12
  hf_oauth_expiration_minutes: 480
13
  ---
14
 
15
+ **Project Overview**
16
+ Developed an Agentic RAG system using LangGraph that orchestrates a multi-step workflow combining retrieval and reasoning capabilities. The agent integrates multiple search tools (Wikipedia, Arxiv, web search via Tavily), mathematical operations, and a Supabase vector database for semantic similarity search and question retrieval. For databse setup, run *supabase_sql_setup.sql*
17
+
18
+ **Evaluation Process**
19
+ The project was evaluated using the GAIA benchmark, specifically testing against 20 questions extracted from the level 1 validation set. This rigorous evaluation measured the agent's ability to handle complex, multi-step reasoning tasks. Performance was assessed through automated scoring, providing detailed metrics including overall accuracy percentage and correct answer counts.
20
+
21
+
22
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
23
+
supabase_sql_setup.sql ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- First, make sure you have the vector extension enabled
2
+ -- First, make sure you have the vector extension enabled
3
+ CREATE EXTENSION IF NOT EXISTS vector;
4
+
5
+ -- Create the documents table if it doesn't exist
6
+ CREATE TABLE IF NOT EXISTS documents (
7
+ id SERIAL PRIMARY KEY,
8
+ content TEXT,
9
+ metadata JSONB,
10
+ embedding VECTOR(768)
11
+ );
12
+
13
+ -- Create the similarity search function that LangChain expects
14
+ CREATE OR REPLACE FUNCTION match_documents_langchain_2(
15
+ query_embedding VECTOR(768),
16
+ match_threshold FLOAT DEFAULT 0.6,
17
+ match_count INT DEFAULT 10
18
+ )
19
+ RETURNS TABLE (
20
+ id BIGINT,
21
+ content TEXT,
22
+ metadata JSONB,
23
+ similarity FLOAT
24
+ )
25
+ LANGUAGE SQL STABLE
26
+ AS $$
27
+ SELECT
28
+ documents.id,
29
+ documents.content,
30
+ documents.metadata,
31
+ 1 - (documents.embedding <=> query_embedding) AS similarity
32
+ FROM documents
33
+ WHERE 1 - (documents.embedding <=> query_embedding) > match_threshold
34
+ ORDER BY documents.embedding <=> query_embedding
35
+ LIMIT match_count;
36
+ $$;
37
+
38
+ -- Create an index on the embedding column for better performance
39
+ CREATE INDEX IF NOT EXISTS documents_embedding_idx
40
+ ON documents USING ivfflat (embedding vector_cosine_ops)
41
+ WITH (lists = 100);